approvedcompleteApache-2.0
CoreLedger Postgres driver: scaling as a driver swap, proven
011-coreledger-postgres-driver
The Postgres LedgerDriver that spec 003 stages as future work. The forcing function is the Statecraft control plane: it is itself an EnRaHiTu app but carries webhook bursts, audit writes, and multi-tenant state, so it runs CoreLedger-on-Postgres while stamped customer apps run CoreLedger-on-libSQL/Turso. Same decorator surface, different driver; the "scaling is a driver swap, not a rewrite" thesis is validated by running the exact spec 003 test suite, unchanged, against both drivers. Selection is by URL scheme; the driver owns dialect DDL, `?`-to-`$n` placeholder translation, and a minimal forward-only migration runner.
- Depends on
- Establishes
- backend/core/ledger/postgres.ts
- backend/core/ledger/migrations.ts
- backend/core/ledger/postgres.test.ts
- Sections
- 011: CoreLedger Postgres driver
- 1. Purpose
- 2. Territory
- 3. Design constraints
- 4. Acceptance
- 5. Out of scope
- 6. Status
- Source
- specs/011-coreledger-postgres-driver/spec.md @ dc4c9237e12aas of 2026-07-21 ยท shard ec9dee174c04