mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 17:56:34 +00:00
Lays groundwork for sqlite|postgres backend selection without yet converting Repository. Adds: - db-adapter.ts: async DbAdapter interface (run/get/all/exec/transaction) - sqlite-adapter.ts: wraps node:sqlite sync API in Promise-returning shape, caches prepared statements - pg-adapter.ts: pg Pool + ? → $N placeholder rewrite + RETURNING-id capture + savepoint-nested transactions - service-store config: driver (sqlite|postgres), pgUrl - BF_DB env override, plumbed via envStr Selecting BF_DB=postgres throws at init() until the Repository is converted off DatabaseSync. This commit ships the foundation only. Next phases (separate commits): 2. Convert Repository methods sync → async via DbAdapter 3. Update every caller to await 4. Split MIGRATIONS into sqlite + portable / pg-specific sets 5. UUIDv7 IDs for new tables on PG path Adds deps: pg ^8.13.1, uuidv7 ^1.0.2, @types/pg ^8.20.0 |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| bsb-tests.json | ||
| package.json | ||
| tsconfig.json | ||