AGENTS.md@public/files/anarlog/packages/db · git:20260915.997c05b · 2026-09-15 · sha256 151efbe8149e729b
AGENTS.md@public/files/anarlog/packages/db git:20260915.997c05bA
Immutable. This exact content is served forever at /api/v1/blob/151efbe8149e729b.
# `packages/db` ## Role - Owns the Drizzle-facing TypeScript adapter for the app database schema. - Exposes `createDb(...)` and re-exports the Drizzle schema/helpers used by app code. ## Invariants - This package is a thin Drizzle adapter, not a generic SQL transport layer. - `createDb(...)` must talk to a transport that implements the Drizzle sqlite-proxy contract directly. - Drizzle proxy reads and writes use `executeProxy(sql, params, method)`. - `executeProxy(...)` returns positional rows in SQL select order, as expected by `drizzle-orm/sqlite-proxy`. - This package must not parse SQL or remap named object rows into positional proxy rows. - Named object rows remain the responsibility of the generic live-query transport below this layer. ## Dependency Direction - May depend on `@anlg/db-runtime` for the proxy client contract. - Must not own Tauri/mobile transport details or database initialization.