Documentation · v0.2
Zanith documentation.
A SQL data engine that doesn't generate code. Schema parses once at startup into a runtime graph; queries compile to parameterized SQL on the way out. These docs cover installation, schema, queries, advanced features, and the full reference.
Getting Started
Install the engine and run your first query in under a minute.
Prisma compat
Run a Prisma codebase on the Zanith engine — one file changes, with a doctor that tells you what to expect first.
Schema
How models, fields, relations, and enums get into the runtime graph.
- →OverviewWhat the schema graph holds, how it's built, when it runs.
- →Models & fieldsScalar types, modifiers, field-level attributes.
- →Relations1:1, 1:N, M:N — all expressed in the schema graph.
- →EnumsLiteral value sets, default mapping, validation.
- →.zanith DSLupdatedThe file-based schema syntax, parser semantics.
- →MixinsReusable field bundles — id, timestamps, audit.
Queries
The model API: CRUD, filters, relations, aggregates.
- →OverviewThe shape of a typed query, how it compiles.
- →CRUDupdatedfindMany / findFirst / findUnique / create / update / delete · plus include for eager-loaded relations.
- →Filters & whereEvery operator, with shape and compiled SQL.
- →Relationsinclude, nested where, multi-hop joins.
- →AggregatesgroupBy, count, sum, avg, having.
- →Insert & upsertRETURNING semantics, ON CONFLICT, bulk inserts.
Advanced
Transactions, raw SQL, JSONB, window functions, subqueries, set ops, LATERAL, LISTEN/NOTIFY, expression builders.
- →OverviewupdatedIndex of every page in this section.
- →TransactionsBEGIN/COMMIT/ROLLBACK semantics, isolation levels.
- →Raw SQLTagged template, parameter binding, type assertions.
- →JSONBPath expressions, indexed lookups, jsonb operators.
- →Window functionsrowNumber, rank, partition by, OVER clauses.
- →SubqueriesEXISTS, IN, correlated subqueries.
- →Set operationsnewunion, intersect, except — combine query results, parameters renumbered.
- →LATERAL joinsnewlateralJoin — top-N per group and other patterns plain JOIN can't express.
- →LISTEN / NOTIFYnewPostgres pubsub via listen, unlisten, notify.
- →Expression buildersnewcaseWhen, coalesce, nullIf, fn — plus standalone JSON / array / range helpers.
Production
Plugins, observability, multi-tenancy, search, Postgres extensions — what running the engine in production looks like.
- →OverviewnewWhat the production-readiness surface covers and where each piece lives.
- →PluginsnewZanithPlugin · onQuery / onResult / onError. Author your own observability or interception.
- →ObservabilitynewconsoleLogger, slowQueryLogger, structuredLogger, openTelemetryPlugin — drop-in.
- →Multi-tenancynewThree strategies — row-level, schema-based, database-based — packaged as plugins.
- →SearchnewFull-text + trigram + vector ranking in one query. tsvector setup. Faceting helper.
- →Postgres extensionsnewTyped wrappers for pgvector, pg_trgm, pgcrypto, pg_cron.
Studio
The bundled web UI. Install @zanith/studio, run `zanith studio`, get every database surface.
- →OverviewnewInstall, launch, the eight surfaces — at a glance.
- →Workspace levelnewCross-database — connections, activity, search.
- →Tables surfacenewBrowse, edit, bulk operations, sensitive masking.
- →SQL playgroundnewMulti-tab editor, plan history, watch, charts.
- →Security tabnewLock graph, RLS, roles, permission matrix.
- →CatalognewViews, sequences, triggers, functions, indexes.
- →Launch + authnewThree deployment shapes — local, staff, viewer.
Migrate
Generate, plan, verify, apply — with risk scoring, shadow verification, and a recovery layer.
- →OverviewnewThe CLI surface and the failure paths, in summary.
- →Lifecyclenewgenerate · plan · verify · apply · audit, with failure paths.
- →Risk modelnewSix levels, twenty reason codes, three CI gates.
- →Shadow-DB verifynewThe gate that catches drift before up touches production.
- →Recovery (Phase 2)newSoft-drop, archive, restore, export, purge.
- →Audit + historynewFour bookkeeping tables, the history CLI, snapshot replay.
- →Expand-contractnewexpandContractRename / expandContractTypeChange — paired plans for safe schema changes under a live app.
- →Preflight checksnewpreflightCheck probes the live data before risky DDL — duplicates, orphans, NULLs.
- →Programmatic APInewapplyMigrations, listMigrationSteps, snapshots, artifacts — the engine surface the CLI is built on.
Reference
Configuration, type system, command-line tooling.
v0.2 · early
Some pages on this surface are stubs for features that are on the roadmap, not yet shipped — they're marked planned in the sidebar. Everything else describes the engine as it ships today. The full status list lives on /roadmap.