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

TypePostgreSQL typeTypical use
uuiduuidPrimary keys, references to user ids
texttextNames, emails, the user column
integerintegerCounters, small numbers
bigintbigintLarge counters, external ids
booleanbooleanFlags
timestamptztimestamptzTimestamps with time zone
jsonbjsonbFlexible structured data
numericnumericExact decimals, money
doubledouble precisionFloating-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:

customers
ColumnTypeConstraints
iduuidPrimary key · default gen_random_uuid()
nametextNot null
emailtextNot null
plantextNot null
owner_idtextNot 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

ChangeSupported?How
Add a columnYesTable screen → add column (not as a primary key)
Drop a columnYesExcept the primary key and the user column
Add a primary keyNoCreate the table with the right key
Attach a user columnNoRecreate the table, or write an equivalent policy on the Policies screen
Run DDL in the SQL editorNoThe editor is read-only; use the table screen

Additional resources