Status: Accepted · 2026-08-20
Context
The blueprint specifies Postgres for the control plane. A single founder needs the test suite to run in a second with no services to start.Decision
Implement the control-plane store onnode:sqlite, keeping the parts that matter
portable:
the SQL schema and its constraints
the repository interface
the rule that every organization-scoped read takes an
organizationId and filters in the query rather than afterwardspackages/db/src/sqlite.ts. Nested transactions
use savepoints so a caller can compose writes without knowing whether it is
already inside one.
Consequences
- Tests construct a full control plane per suite; the fixtures are real.
- Postgres-only features — row-level security,
jsonboperators, advisory locks — are not used yet. Migration locking is implemented in the app database instead, which is where it belongs anyway. - Moving to Postgres means reimplementing
Databaseand the repositories, not the callers.