zitejs/db:
zite, addressed by its SDK name (PascalCase), with
fully-typed record types. Read the generated .zite/db.ts to see the exact names and types.
Methods
Filters and sorting
Filters are objects keyed by field SDK name. A bare value means equality; an object applies an operator:There is no
eq or neq here — equality is the bare-value shorthand. The row filters in
zite.permissions.json are a separate system and do have eq and neq.sort: [{ field: 'createdAt', direction: 'desc' }]. Use fields: ['subject', 'status']
to fetch only the columns you need.
Read-only SQL
zite.sql() runs a single read-only SELECT against the workspace database using human-readable SDK names:
Postgres lowercases unquoted names, which is why everything but the system columns must be double-quoted.
The
.zite/db.ts header lists the link tables for your workspace.
Results are capped at 2,000 rows; truncated is true when the cap is hit.
Also on the client
The generatedzite object also exposes zite.notifications (see Notifications)
and zite.meta.listUsers() for the workspace’s users.