@eristack/ai-knowledge
drizzle-app-database
28 linesSource
App-owned Drizzle boot with @eristack/drizzle openDrizzle: one pool or sqlite file, dialect from APP_DB_DIALECT/DATABASE_URL, lazy drivers, redacted health location. Table factories stay on @eristack/*/drizzle; inject db at compose root. Step 2 schema recipe same package.
Drizzle app database
Load @eristack/drizzle#drizzle-core when wiring code; this skill is the policy boundary.
- Never open connections inside @eristack/jwt-auth, epoch, tax, or other table packages.
- openDrizzle({ schema, migrationsFolder }) once — module scope or Nest useFactory.
- @eristack/drizzle-kit-helpers for two migration trees (sqlite tests, pgsql prod).
- B4 one collection declaration — wait until B3 step 2 column helpers exist.
ts
const { db, location } = await openDrizzle({ schema, migrationsFolder: { sqlite: "…", pgsql: "…" } });