Skip to main content
Every table automatically has id (uuid), created_at, and updated_at - never add those columns yourself.

CRUD

Filters and modifiers

  • Filters chain: .eq() .neq() .gt() .gte() .lt() .lte() .like() .ilike() .in() .is()
  • Modifiers: .order() .limit() .range() .single() .maybeSingle()
  • Postgres functions: backend.database.rpc("fn_name", { arg: 1 })

Row-level security

Tables created by result db create-table with a user_id uuid column get an owner policy automatically: rows are scoped to the signed-in user and user_id fills in on insert. After sign-in, queries just return the right rows. An RLS table with no policy denies everything: writes fail with 403 (Postgres code 42501) and reads return empty arrays with no error. If that happens, add a policy (or recreate the table through the CLI) - the data is not lost.

Changing schema

Tables and migrations are CLI operations, not SDK calls:
See CLI reference.