zmdbzero-maintenance data layer
Docs Benchmarks Anti-patterns OpenAPI
Docs / Operations and deployment

Deployment TutorialsSupported

End-to-end walkthroughs, as opposed to the task-shaped answers in Guides. Each one starts from an empty directory and ends with something running.

Start here#

Quick Start — a schema, a query, a typed result, in about five minutes. Read this before anything else on this page.

Your First Application — a controller, a module, a repository behind DI, and a route that returns real rows.

The three things that trip people up on day one#

Worth knowing before you follow any tutorial, because each one otherwise interrupts the first working run:

The AOT transformer must be configured. If it is not, is<T>() and assert<T>() throw because the erased type argument has no runtime witness. Write this test first, in every project:

it('the transformer is running', () => {
  expect(is<{ id: number }>({ id: 'x' })).toBe(false);
});

See AOT Setup.

References is a tag, not a call. The target is a table.column string literal, so there is nothing to import and no schema value to have on hand:

authorId: number & Sql<'integer'> & References<'users.id'>;

The query builder is immutable. b.where(...) returns a new builder; it does not modify b. Chain or reassign.

Deploying#

DeploymentThe general shape: build, migrate, roll
VercelFunctions, and the connection arithmetic
Next.jsServer components, route handlers, the bundler
NetlifyFunctions and edge functions
Supabase Edge FunctionsDeno, and the transformer problem
RailwayA long-running container, which is the easy case
EncoreInfrastructure-from-code, and where it conflicts

Client applications#

Start with one generated HTTP client, then choose the framework guide that owns the application lifecycle:

Client Applicationssupport and ownership across all nine integrations
Reactcontext, hooks, cancellation, and request-local SSR
AngularDI, signals, DestroyRef, and RxJS cancellation
Vueplugin injection, reactive state, and SSR isolation
Sveltecontext, lazy stores, and subscriber teardown
Solidresources, owner disposal, Suspense, and errors
React NativeAppState, connectivity, credentials, and Metro
Next.jsApp Router request scopes and browser separation
NuxtNitro request clients and native hydration
SvelteKitevent fetch, load helpers, and navigation aborts

Local development#

Local PostgresDocker, fast resets, psql
Local MySQLDocker, and the collation settings that matter
PGlitePostgres in-process, no daemon
TestingCompile SQL with no database; fake the driver

Going deeper#

Schema DeclarationColumns, relations, options
Repository APIEvery method, with the DTO types
MigrationsSnapshot, diff, emit, run
OpenAPI GenerationControllers to a spec
Anti-PatternsWhat zmdb deliberately will not do

---

See also: Quick Start · Guides · Deployment