@detiq/database
v1.1.19
Published
This package defines the "sealed boxes" (Workspace -> Tenant -> Project) and the **Zeta Core** (Screens, Elements, Flows, Skill Files, Test artifacts).
Readme
@detiq/database — The Data Model & Zeta Core
This package defines the "sealed boxes" (Workspace -> Tenant -> Project) and the Zeta Core (Screens, Elements, Flows, Skill Files, Test artifacts).
Why a normal database (not a vector database)?
Because the workspace is closed and bounded, we ground the AI by loading a
project's knowledge directly (see @detiq/app-brain). A normal Postgres
database is simpler, cheaper, precise, and easy to isolate per tenant. We add
vector search later only for projects flagged oversized = true.
Tenant isolation is enforced HERE, at the database layer
migrations/0001_tenant_isolation/migration.sql turns on Row-Level Security.
Every query must run inside withTenant(tenantId, ...). If you forget, the
database returns nothing — the safe failure mode.
Commands
npm run -w @detiq/database generate # build the Prisma client
npm run -w @detiq/database migrate # create/update tables
npm run -w @detiq/database studio # visual database browser