Build

Defining models (the ORM DSL)

Compose typed PostgreSQL schemas with fluent columns, relations, indexes, constraints, and migrations-ready model metadata.

The model() DSL is the source of truth for a module's PostgreSQL schema. Models generate migration snapshots, row types, Zod schemas, and service accessors, so keep one model per file and review every generated migration.

Move on to dedicated details: