Also available: Markdown version · llms.txt · full site content
Database
Tables and columns
Create tables from the Console. Every table is an ordinary PostgreSQL table in the public schema, with Row Level Security enabled from the start.
The rules a table follows
- Names are lowercase: a letter first, then letters, digits, and underscores (up to 41 characters).
- Exactly one primary key column, chosen at creation. You cannot add or drop a primary key later.
- Up to 64 columns per table.
- Columns can be added and dropped later — except the primary key and the user column used for row policies.
Column types
| Type | PostgreSQL type | Typical use |
|---|---|---|
uuid | uuid | Primary keys, references to user ids |
text | text | Names, emails, the user column |
integer | integer | Counters, small numbers |
bigint | bigint | Large counters, external ids |
boolean | boolean | Flags |
timestamptz | timestamptz | Timestamps with time zone |
jsonb | jsonb | Flexible structured data |
numeric | numeric | Exact decimals, money |
double | double precision | Floating-point measurements |
Columns are NOT NULL by default; mark a column nullable when it may be empty. Available defaults are gen_random_uuid(), now(), true, and false.
A worked example
The customers table used throughout these docs:
| Column | Type | Constraints |
|---|---|---|
id | uuid | Primary key · default gen_random_uuid() |
name | text | Not null |
email | text | Not null |
plan | text | Not null |
owner_id | text | Not null · user column |
With owner_id set as the user column, the API role can only read and write rows whose owner_id equals the JWT subject of the caller. The Console keeps full access through a separate developer policy.
Changing a table later
| Change | Supported? | How |
|---|---|---|
| Add a column | Yes | Table screen → add column (not as a primary key) |
| Drop a column | Yes | Except the primary key and the user column |
| Add a primary key | No | Create the table with the right key |
| Attach a user column | No | Recreate the table, or write an equivalent policy on the Policies screen |
| Run DDL in the SQL editor | No | The editor is read-only; use the table screen |