Core concepts
Database
Realtime
Functions
Core concepts
Schema
Define tables, columns and relations in TypeScript. The schema drives the database, the API and the client.
Tables and columns
A table is a named collection of typed columns. Column builders map directly to Postgres types, and modifiers like .notNull() and .unique() become constraints.
Column types
Builder | Postgres type | TypeScript type |
|---|---|---|
| uuid |
|
| text |
|
| integer |
|
| boolean |
|
| timestamptz |
|
| jsonb |
|
Relations
Use references() to link tables. Tessera creates the foreign key and adds typed helpers to the client for joins.
Rename safely
Renaming a column in the schema is detected as a rename, not a drop and add, so existing data is kept.
Was this helpful?
© 2026 Tessera, Inc.
Support
Status