npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@paykernel/sql-foundation

v0.1.0

Published

Shared relational schemas, codecs, migrations, and claim algorithms for PayKernel durable SQL store adapters. Not a general ORM.

Readme

@paykernel/sql-foundation

Shared relational foundation for PayKernel durable SQL store adapters:

| Area | Contents | | ---------- | ------------------------------------------------------------------------------------------------------- | | Schema | Canonical logical tables/columns for idempotency, webhook inbox, reconciliation jobs, migrations ledger. Webhook gateway / provider_event_id / receive timestamps are operator columns — store claim() does not populate them. Idempotency expired and webhook failed are CHECK-legal; official postgres stores do not write them. | | Namespace | Validated table prefix, PostgreSQL schema, optional tenantColumn flag. v1 enables a nullable tenant_id column + index only — it does not isolate tenants, does not write tenant_id from stores, and does not use a custom column name in DDL (always tenant_id). PK remains key. Prefix keys or wait for a later schema if you need isolation. | | Codecs | Row ↔ record mapping + shared validation (ISO timestamps, opaque tokens, max error size) | | Migrations | Versioned DDL + explicit migrate() / verifySchema() (never auto on import). When sqlSchema is set, migrate() issues CREATE SCHEMA IF NOT EXISTS; operators still need CREATE privilege. | | Claims | Pure evaluateClaim / decide* + dialect SQL templates + complete/fail fencing + A3 harness | | Reference | Memory-relational (mutex) + optional reference/bun-sqlite-store.test (sync txn; not on main export) |

Publishable. This package is the public packaging of the former private @paykernel/internal-sql-store foundation (ship-blocker B8 option B). Adapters depend on @paykernel/sql-foundation at runtime so published tarballs resolve on npm. The monorepo keeps internal/sql-store as a thin re-export for workspace compatibility.

Not a general SQL abstraction

Intentionally narrow: schemas, codecs, migrations, claim intent/templates, and test reference helpers. Not a query builder or ORM.

Consumers

Redis adapter does not depend on this package.

Install

Usually installed transitively via a store adapter:

bun add @paykernel/store-postgres
# pulls @paykernel/sql-foundation + @paykernel/store-contracts

Boundaries

  • Must not depend on @paykernel/core, @paykernel/webhooks, or @paykernel/reconciliation (field names align with store contracts by convention).
  • Domain packages must not depend on sql-foundation (storage is injected).

Documentation

| Doc | Topic | | --- | --- | | docs/relational-foundation.md | Purpose, tables, namespace, migration policy | | docs/migrations.md | Explicit migrate/verify | | docs/atomic-claims.md | Atomic claim rules |

Store contract types: @paykernel/store-contracts.