Docs

CLI: Database, documents and schema

Run SQL, manage tables and migrations and environments (with a sample of the data), apply app templates, check app builds and open them as pull requests, read and write documents, inspect the schema and generate types with sov.

Updated Nov 25, 2026
# migrations/20261016_add_note.sql
#   alter table books add column note text;
#   -- migrate:down
#   alter table books drop column note;
sov db migrations --help

#sov db

Database (SQL) management

sov db tables

List live relational tables in the linked project database.

sov db tables [OPTIONS]

Arguments and options

--migrationsflagoptional
Show migration log only (legacy behaviour)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db sql

Execute SQL against the project database.

sov db sql [OPTIONS] [QUERY]

Use --interactive for a mini psql-style loop.

Arguments and options

QUERYtextoptional
SQL query to execute
--interactive / -iflagoptional
Interactive SQL REPL
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db query

Read rows with the filters in the request body: QUERY /rest/v1/<table> (same read as GET, no URL limit).

sov db query [OPTIONS] TABLE

Arguments and options

TABLEtextrequired
The table (or view) to read
--bodytextrequired
JSON of parameter → value, as /rest/v1 takes them: '{"select": "id,total", "id": "in.(1,2,3)", "limit": 50}' (a list repeats a parameter); or @file / @- for stdin
--postflagoptional
Use POST /rest/v1/_query/<table> (networks that block QUERY)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db create-table

Create a new relational table.

sov db create-table [OPTIONS] NAME COLUMNS_JSON

Arguments and options

NAMEtextrequired
Table name
COLUMNS_JSONtextrequired
Columns as JSON array, e.g. '[{"name":"id","type":"SERIAL","primary_key":true}]'
--foreign-keystextoptional
JSON array of FK defs
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db as-of

Show TABLE exactly as it was at a moment (sov_as_of).

sov db as-of [OPTIONS] TABLE AT

Arguments and options

TABLEtextrequired
Table with history on
ATtextrequired
A time, e.g. '2026-10-17 09:00+05:30' or '2 hours ago'
--wheretextoptional
SQL condition on the table's columns, e.g. "id = 7"
--limitint rangeoptionaldefault 100
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db schema

The schema as one short line per table: types, keys, →references, allowed values, indexes, owner rows.

sov db schema [OPTIONS]

Arguments and options

--tablestextoptional
Comma-separated tables to expand in a big schema
--fullflagoptional
Every table in full, however long
--jsonflagoptional
Print the raw response (version, tables, text)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db plan

Create or extend tables from a plan: checked, then applied as one reversible migration (sov db migrations rollback undoes it).

sov db plan [OPTIONS] FILE

Columns: objects, or short form like "status text!='draft' in(draft|live)" or "customer_id →customers cascade".

Short form marks: ! required, =default, pk, uniq, idx, in(a|b), >0, →table (then cascade or setnull).

New tables get an id uuid key and created_at. Patterns: owner_rows, public_read, timestamps, soft_delete.

Arguments and options

FILEfilerequired
JSON: {"tables": [{"name": "orders", "columns": ["total money!", "customer_id →customers"], "patterns": ["owner_rows"]}]}
--dry-runflagoptional
Check it and print the SQL; change nothing
--yes / -yflagoptional
Apply without asking
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db push

Apply pending migrations (same as sov db migrations push, like supabase db push).

sov db push [OPTIONS]

Arguments and options

--dirtextoptional
Migration directory (default: sovaria/migrations under linked project)
--dry-runflagoptional
Run all pending migrations in order in one transaction and roll it back (nothing is kept)
--include-rolled-backflagoptional
Also apply files whose migration was rolled back on the server (skipped by default)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db pull

Introspect remote SQL schema and write a migration SQL snapshot (Supabase db pull).

sov db pull [OPTIONS]

Arguments and options

--output / -opathoptional
Write schema SQL file (default: sovaria/migrations/<timestamp>_remote_schema.sql)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db diff

Compare remote schema against the last local snapshot from sov db pull.

sov db diff [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db reset

Drop all user tables and optionally re-apply local migrations (destructive).

sov db reset [OPTIONS]

Arguments and options

--yes / -yflagoptional
Skip confirmation prompt
--migrations / --no-migrationsflagoptional
Re-apply local migration files after reset
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db seed

Run seed SQL against the linked database (Supabase db seed).

sov db seed [OPTIONS]

Arguments and options

--file / -fpathoptional
Seed SQL file
--dirpathoptional
Directory of seed SQL files (default: sovaria/seeds)
--dry-runflagoptional
List the seed files and the target; run nothing
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db sleep

Whether the project's database and each environment's is asleep (idle databases sleep and wake on the next request: staging, branch and preview databases after 3 idle days, Free projects after 14; paid production never).

sov db sleep [OPTIONS]

Arguments and options

--jsonflagoptional
Print the raw response
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db wake

Wake a sleeping database now; returns once it accepts connections (a few seconds).

sov db wake [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db restore

Restore the database to a moment (point-in-time recovery).

sov db restore [OPTIONS]

It is recovered beside production and checked first; a safety backup is taken; undo within 7 days (sov governance db-restore-undo). With --into-env / --into-project the backup or moment goes there instead and production stays as it is.

Arguments and options

--totextoptional
The moment: '2026-10-22T14:32:00Z', '2026-10-22 14:32 +05:30', '2026-10-22 14:32' (your time zone) or '15 minutes ago'
--verifyflagoptional
Only recover a copy beside production and check it (changes nothing)
--into-envtextoptional
Put the backup / moment into this environment instead (its data is replaced; production is not changed)
--into-projecttextoptional
Or into another project of the organization
--backupintegeroptional
With --into-env / --into-project: a backup id instead of --to
--wait / --no-waitflagoptional
Follow the restore until it finishes
--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db restore-tables

Copy tables from a backup or a moment into production as restored_<table>_<stamp>, beside the live ones (live tables are not changed).

sov db restore-tables [OPTIONS] TABLES

Merge with SQL afterwards, e.g. INSERT … SELECT … ON CONFLICT DO NOTHING.

Arguments and options

TABLEStextrequired
Tables to bring back: schema.table or table (public)
--totextoptional
A moment (point-in-time recovery)
--backupintegeroptional
Or a backup id (sov db backups list)
--wait / --no-waitflagoptional
Follow the job until it finishes
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db tx begin

Begin a relational transaction and return txid.

sov db tx begin [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db tx commit

Commit an open transaction.

sov db tx commit [OPTIONS]

Arguments and options

--txidintegerrequired
Transaction id from sov db tx begin
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db tx rollback

Rollback an open transaction.

sov db tx rollback [OPTIONS]

Arguments and options

--txidintegerrequired
Transaction id from sov db tx begin
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db history list

Tables that keep history, their versions and how far back they go.

sov db history list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db history on

Start keeping every version of TABLE's rows (read them with sov db as-of).

sov db history on [OPTIONS] TABLE

Arguments and options

TABLEtextrequired
Table (needs a primary key)
--keep-daysint rangeoptional
Days versions are kept (default and maximum: your plan's)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db history off

Stop keeping history for TABLE and delete its stored versions.

sov db history off [OPTIONS] TABLE

Arguments and options

TABLEtextrequired
--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db replicas list

Replicas with status, connection string and how far behind the primary they are.

sov db replicas list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db replicas add

Start a read replica (copies the database first; sov db replicas list shows when it's ready).

sov db replicas add [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db replicas remove

Remove a replica (apps connected to it lose their connection).

sov db replicas remove [OPTIONS] REPLICA_ID

Arguments and options

REPLICA_IDtextrequired
--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db column add

Add a column to an existing table.

sov db column add [OPTIONS] TABLE NAME

Arguments and options

TABLEtextrequired
Table name
NAMEtextrequired
Column name
--typetextrequired
SQL data type, e.g. TEXT or INTEGER
--nullable / --not-nullflagoptional
--uniqueflagoptional
--defaulttextoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db column drop

Drop a column from a table.

sov db column drop [OPTIONS] TABLE NAME

Arguments and options

TABLEtextrequired
NAMEtextrequired
Column name
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db fk add

Add a foreign key between tables.

sov db fk add [OPTIONS] TABLE COLUMN

Arguments and options

TABLEtextrequired
COLUMNtextrequired
--ref-tabletextrequired
--ref-columntextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db fk drop

Drop a foreign key.

sov db fk drop [OPTIONS] TABLE COLUMN

Arguments and options

TABLEtextrequired
COLUMNtextrequired
--ref-tabletextrequired
--ref-columntextrequired
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db migrations new

Create a new timestamped SQL migration file (Supabase-style).

sov db migrations new [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Migration slug, e.g. add_users_table
--dirtextoptional
Migration directory

sov db migrations list

List remote migration log entries or local migration files.

sov db migrations list [OPTIONS]

Arguments and options

--tabletextoptional
--limitintegeroptionaldefault 100
--offsetintegeroptionaldefault 0
--localflagoptional
List local .sql files only
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db migrations push

Apply pending .sql migrations through the project's migration history.

sov db migrations push [OPTIONS]

Each file is applied atomically and recorded on the server, so every teammate and CI run sees the same history. Put rollback SQL under a -- migrate:down line (or in <name>.down.sql) to make a migration reversible with sov db migrations rollback. A migration rolled back on the server stays rolled back: push skips its file unless you pass --include-rolled-back.

Arguments and options

--dirtextoptional
Migration directory (default: sovaria/migrations under linked project)
--dry-runflagoptional
Run all pending migrations in order in one transaction and roll it back (nothing is kept)
--include-rolled-backflagoptional
Also apply files whose migration was rolled back on the server (skipped by default)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db migrations rollback

Undo the most recent migration using its down SQL.

sov db migrations rollback [OPTIONS]

Arguments and options

--versiontextoptional
Roll back this version (needs --force if it isn't the latest)
--forceflagoptional
Allow rolling back a migration that isn't the most recent
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db migrations pull

Fetch remote migration log (schema change history) as JSON.

sov db migrations pull [OPTIONS]

Arguments and options

--output / -otextoptional
Write remote migration log JSON to this path
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db pitr status

Whether point-in-time recovery is on and the earliest and latest moment you can restore to.

sov db pitr status [OPTIONS]

Arguments and options

--jsonflagoptional
Print the raw response
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db pitr enable

Turn on point-in-time recovery (Pro and higher).

sov db pitr enable [OPTIONS]

Arguments and options

--restartflagoptional
Allow the one database restart (a few seconds) it may need
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db pitr disable

Stop archiving changes.

sov db pitr disable [OPTIONS]

What was archived stays restorable until it leaves the window.

Arguments and options

--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db backups list

Recent backups (daily, manual, before restores): id, when, size, status, until when kept.

sov db backups list [OPTIONS]

Arguments and options

--limitint rangeoptionaldefault 20
--jsonflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db backups now

Take a backup now (db.manual_backups_hour / _month apply).

sov db backups now [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db backups download

Download a backup (plain SQL, gzip), streamed to a file.

sov db backups download [OPTIONS] BACKUP_ID

Restore it anywhere with gunzip -c FILE | psql "$DATABASE_URL". Owners, admins and developers only.

Arguments and options

BACKUP_IDintegerrequired
The backup id (sov db backups list)
--output / -opathoptional
File to write (default sovaria-backup-<project>-<id>.sql.gz)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db backups health

Backup health: last good backup, failures since, recovery point (RPO), retention and on-demand allowance.

sov db backups health [OPTIONS]

Arguments and options

--jsonflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db advisor

Index advisor: indexes that would speed up the slowest queries, tested as hypothetical indexes first

sov db advisor [OPTIONS]

Arguments and options

--queryidtextoptional
Only this statement (from sov db insights)
--jsonflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db advisor query

Recommend indexes for one statement.

sov db advisor query [OPTIONS] SQL

Arguments and options

SQLtextrequired
One SELECT / WITH / UPDATE / DELETE (only EXPLAINed, never run)
--jsonflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db advisor apply

Build a recommended index with CREATE INDEX CONCURRENTLY (no write lock); follow it with status.

sov db advisor apply [OPTIONS]

Arguments and options

--tabletextrequired
schema.table (public. may be left out)
--columnstextrequired
Comma list, in index order (1-3)
--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db advisor status

Whether an index the advisor started is building, ready, failed or invalid.

sov db advisor status [OPTIONS] INDEX_NAME

Arguments and options

INDEX_NAMEtextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db insights

Query insights: the project's statements by total time, average, calls…

sov db insights [OPTIONS]

Arguments and options

--sorttextoptionaldefault total
total, mean, calls, max or rows
--limitint rangeoptionaldefault 20
--jsonflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov db insights reset

Clear this database's query statistics.

sov db insights reset [OPTIONS]

Arguments and options

--yes / -yflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov data

Documents and SQL data plane

sov data doc-put

Write a plain JSON document.

sov data doc-put [OPTIONS] COLLECTION DOCUMENT_ID DATA

Arguments and options

COLLECTIONtextrequired
Collection path
DOCUMENT_IDtextrequired
Document key
DATAtextrequired
JSON object document body
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data doc-get

Read a plain JSON document.

sov data doc-get [OPTIONS] COLLECTION DOCUMENT_ID

Arguments and options

COLLECTIONtextrequired
DOCUMENT_IDtextrequired
--txidintegeroptionaldefault 0
Optional historical txid
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data doc-delete

Delete a document.

sov data doc-delete [OPTIONS] COLLECTION DOCUMENT_ID

Arguments and options

COLLECTIONtextrequired
DOCUMENT_IDtextrequired
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data doc-scan

Scan documents by key prefix or range.

sov data doc-scan [OPTIONS]

Arguments and options

--prefixtextoptional
--start-keytextoptional
--end-keytextoptional
--limitintegeroptionaldefault 100
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data sql

Run a SQL query.

sov data sql [OPTIONS] SQL

Arguments and options

SQLtextrequired
SQL statement
--txidintegeroptionaldefault 0
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data table-create

Create a relational table.

sov data table-create [OPTIONS] TABLE_NAME COLUMNS

Arguments and options

TABLE_NAMEtextrequired
COLUMNStextrequired
JSON array of column definitions
--foreign-keystextoptional
JSON array
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data table-drop

Drop a relational table.

sov data table-drop [OPTIONS] TABLE_NAME

Arguments and options

TABLE_NAMEtextrequired
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data table-migrations

List migration log entries.

sov data table-migrations [OPTIONS]

Arguments and options

--tabletextoptional
--limitintegeroptionaldefault 100
--offsetintegeroptionaldefault 0
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov collections

NoSQL document collections

sov collections list

List document collections in the linked project.

sov collections list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov collections query

Field query on a collection or, with --group, a collection group (same rules and row policies as the app).

sov collections query [OPTIONS] COLLECTION

Arguments and options

COLLECTIONtextrequired
Collection path, e.g. posts or users/alice/posts
--wheretextoptional
JSON filters, ANDed: '[["age", ">=", 18]]'. OR groups: '[{"or": [["status", "==", "open"], ["priority", ">=", 3]]}]'
--order-bytextoptional
JSON: '[["created_at", "desc"]]'
--limitint rangeoptionaldefault 20
--start-aftertextoptional
The previous page's next_cursor (JSON)
--groupflagoptional
Collection group: every collection with this id at any depth (Firestore collectionGroup)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov collections count

How many documents match the filters.

sov collections count [OPTIONS] COLLECTION

Arguments and options

COLLECTIONtextrequired
--wheretextoptional
JSON filters, ANDed: '[["age", ">=", 18]]'. OR groups: '[{"or": [["status", "==", "open"], ["priority", ">=", 3]]}]'
--groupflagoptional
Collection group: every collection with this id at any depth (Firestore collectionGroup)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov collections aggregate

count / sum / average on the server: sov collections aggregate orders --sum total --avg total --where '[["paid","==",true]]'.

sov collections aggregate [OPTIONS] COLLECTION

Arguments and options

COLLECTIONtextrequired
--sumtextoptional
Numeric field to sum (repeatable)
--avgtextoptional
Numeric field to average (repeatable)
--count / --no-countflagoptional
Include the document count
--wheretextoptional
JSON filters, ANDed: '[["age", ">=", 18]]'. OR groups: '[{"or": [["status", "==", "open"], ["priority", ">=", 3]]}]'
--order-bytextoptional
Only matters with --limit
--limitint rangeoptional
Aggregate only the first N results
--groupflagoptional
Collection group: every collection with this id at any depth (Firestore collectionGroup)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov collections nearest

Vector search (Firestore findNearest): sov collections nearest items --field embedding --vector '[0.1,0.2,0.3]' --limit 5.

sov collections nearest [OPTIONS] COLLECTION

Arguments and options

COLLECTIONtextrequired
Collection path (or a collection id with --group)
--fieldtextrequired
The vector field (an array of numbers in each document)
--vectortextrequired
The query vector as JSON, e.g. '[0.1, 0.2, 0.3]'
--limitint rangeoptionaldefault 10
Nearest neighbours (plan cap docs.vector_max_neighbors)
--distancetextoptionaldefault cosine
cosine | euclidean | dot_product
--wheretextoptional
Pre-filter. JSON filters, ANDed: '[["age", ">=", 18]]'. OR groups: '[{"or": [["status", "==", "open"], ["priority", ">=", 3]]}]'
--thresholdnumberoptional
cosine/euclidean: max distance; dot_product: min product
--groupflagoptional
Collection group: every collection with this id at any depth (Firestore collectionGroup)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.
sov collections nearest items --field embedding --vector '[0.1, 0.9, 0.0]' --limit 5 --where '[["kind","==","fruit"]]'

sov collections delete

Delete a collection's documents, or one document, like firebase firestore:delete [-r].

sov collections delete [OPTIONS] PATH

Without -r a document's subcollections stay (as in Firestore); with -r every collection under the path goes too, deepest first. Deletes run through the same collection rules and row policies as the app, 500 per commit.

Arguments and options

PATHtextrequired
A collection (posts, users/u1/orders) or a document (posts/p1)
--recursive / -rflagoptional
Also delete subcollections under it, at any depth
--yes / -yflagoptional
Delete without asking
--dry-runflagoptional
Show what would be deleted, delete nothing
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov collections pipeline

Run a document pipeline: where, aggregate, distinct, sort, offset, limit, select, remove_fields, sample.

sov collections pipeline [OPTIONS] COLLECTION

Example: sov collections pipeline orders --stages '[{"where": ["status","==","paid"]}, {"aggregate": {"accumulators": [{"op": "sum", "field": "amount", "alias": "total"}], "groups": ["country"]}}, {"sort": [["total","desc"]]}, {"limit": 5}]'

Arguments and options

COLLECTIONtextrequired
Collection path, or the group id with --group
--file / -fpathoptional
JSON file: a list of stages or {"stages": [...]}
--stagestextoptional
Stages as inline JSON
--groupflagoptional
Run over the collection group (every collection with this id)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov schema

Database schema introspection

sov schema describe

Describe relational tables and columns (information_schema).

sov schema describe [OPTIONS] [TABLE]

Arguments and options

TABLEtextoptional
Table name (omit for all tables)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov gen

Generate types and client artifacts

sov gen types

Generate typed models from the live SQL schema (Supabase-style).

sov gen types [OPTIONS] LANG

TypeScript: supabase's Database type (Tables Row/Insert/Update, Views, Functions, Enums) for createClient<Database>(url, key), plus one row type per table. Python: Row/Insert/Update TypedDicts. Dart classes with fromJson/toJson (Flutter), Swift Codable structs (iOS) or Kotlin @Serializable data classes.

Arguments and options

LANGtextrequired
typescript | python | dart | swift | kotlin (ts, py, kt also work)
--output / -opathoptional
Write to file instead of stdout
--packagetextoptionaldefault sovaria.generated
Kotlin: the package of the generated file
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov inspect

Inspect databases and project resources

sov inspect db

Show table row estimates and database footprint.

sov inspect db [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov templates

App templates: SaaS, marketplace, chat — backend + starter app

sov templates list

The templates, what each creates and the tables it adds.

sov templates list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov templates show

What a template creates, step by step (and its SQL with --sql).

sov templates show [OPTIONS] NAME

Arguments and options

NAMEtextrequired
saas, marketplace or chat
--sqlflagoptional
Print the SQL its migration runs
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov templates apply

Check, then apply a template to the linked project (each step with your own permissions).

sov templates apply [OPTIONS] NAME

Arguments and options

NAMEtextrequired
saas, marketplace or chat
--dry-runflagoptional
Only check for conflicts and list the steps
--yes / -yflagoptional
Apply without asking after the check
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov templates app

Download the template's React starter app, with .env filled in for the linked project.

sov templates app [OPTIONS] NAME

Arguments and options

NAMEtextrequired
saas, marketplace or chat
--output / -opathoptional
Folder to unpack into (default ./sovaria-<name>)
--zipflagoptional
Save the .zip instead of unpacking it
--no-envflagoptional
Don't fill in .env with the project URL and anon key
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov builds

App builds: check schema, rules, functions and tests; open a pull request

sov builds check

Check a build against the project — nothing changes.

sov builds check [OPTIONS] PATH

Exit 1 when a check fails.

Arguments and options

PATHpathrequired
Build file (.json, .yaml or .yml)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov builds pr

Check the build again and open it as a pull request on the linked repository.

sov builds pr [OPTIONS] BUILD_ID

Arguments and options

BUILD_IDtextrequired
Build id from sov builds check
--yes / -yflagoptional
Don't ask
--github-tokentextoptional
A GitHub token with repo scope instead of the project's GitHub connection
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov builds list

Recent builds of the project.

sov builds list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov builds show

One build: its files, checks and pull request.

sov builds show [OPTIONS] BUILD_ID

Arguments and options

BUILD_IDtextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov builds delete

Forget a build (an opened pull request stays on GitHub).

sov builds delete [OPTIONS] BUILD_ID

Arguments and options

BUILD_IDtextrequired
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov env

Environments: staging, API versions and PR previews (schema, sample or all data)

sov env list

Production plus the project's environments: kind, database status, what it started with, URL.

sov env list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov env create

Create an environment with its own database in the project's container.

sov env create [OPTIONS] NAME

Arguments and options

NAMEtextrequired
lowercase, e.g. staging, preview, v2
--datatextoptionaldefault schema
schema (default: structure only) | empty | sample (masked rows, foreign keys kept; Pro+) | all (every row, masked; Ultra+)
--rowsint rangeoptional
rows per table for --data sample (capped by the plan)
--excludetextoptional
table whose rows are not copied (repeatable)
--tabletextoptional
copy rows of this table only (repeatable)
--mask / --no-maskflagoptional
mask personal columns (owners/admins may turn it off)
--unmasktextoptional
schema.table.column to copy as is (repeatable)
--fromtextoptional
another environment to start from (default production)
--versiontextoptional
make it an API version with this label, e.g. v2
--wait / --no-waitflagoptional
follow the row copy until it finishes
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov env copy

What an environment's database started with and how its row copy went.

sov env copy [OPTIONS] NAME

Arguments and options

NAMEtextrequired
environment name, label or id
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov env delete

Delete an environment and its database (a snapshot is kept first).

sov env delete [OPTIONS] NAME

Arguments and options

NAMEtextrequired
--yes / -yflagoptional
Don't ask for confirmation
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov env previews

Preview environments of the linked GitHub repository's open pull requests.

sov env previews [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov branches

Branches: environments with their own database, functions and policies

sov branches list

Production, every branch and every environment: name, kind (branch, staging or API version), database status and API URL.

sov branches list [OPTIONS]

Arguments and options

--jsonflagoptional
Print the raw JSON
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches get

One branch: id, kind, status and its own API URL.

sov branches get [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Branch name, version label (v2) or id
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches create

Create a branch: a copy of production's system (schema, functions, policies, settings) with its own database.

sov branches create [OPTIONS] NAME

--data picks what the database starts with: the structure only (default) or a checkpoint of the data (sample or all, personal columns masked). --from starts it from another branch or environment instead of production.

Arguments and options

NAMEtextrequired
Branch name: 2-31 characters (letters, digits, - and _)
--fromtextoptional
Start from this branch's tables, functions and policies
--versiontextoptional
Make it an API version with this label (e.g. v2)
--environmentflagoptional
Make a staging environment instead of a branch
--useflagoptional
Switch later commands to the new branch
--datatextoptional
What its database starts with: schema (default), empty, sample, all
--no-maskflagoptional
Copy sample/all rows without masking personal data (owners/admins, audited)
--protectflagoptional
Protected: can't be deleted, reset or restored until unprotected
--expires-inint rangeoptional
Delete it automatically after this many days
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches update

Mark a branch as an API version (live next to production, its URL keeps working) or back to staging.

sov branches update [OPTIONS] NAME

Its data, functions and policies stay as they are.

Arguments and options

NAMEtextrequired
Branch name, version label or id
--versiontextoptional
Make it an API version with this label (e.g. v2)
--stagingflagoptional
Make it a plain staging branch again
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches use

Run later commands (db, functions, storage, …) against this branch.

sov branches use [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Branch name, version label or id; 'production' to go back
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches delete

Delete a branch and its database (a snapshot is kept first).

sov branches delete [OPTIONS] NAME

Production can't be deleted here.

Arguments and options

NAMEtextrequired
Branch name, version label or id
--yes / -yflagoptional
Delete without asking
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches diff

How a branch's database differs from production's (or --against another branch): migrations it has that the other doesn't, and the tables, columns, indexes and policies a deploy would add, change or drop.

sov branches diff [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Branch to compare
--againsttextoptionaldefault production
Compare with this branch (default production)
--jsonflagoptional
Print the raw JSON
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches deploy

Deploy a branch into production (or a staging environment with --to): its migrations, functions, policies and settings, checked first with nothing written (the same as Deploy in the console).

sov branches deploy [OPTIONS] NAME

Its rows stay in the branch.

Arguments and options

NAMEtextrequired
Branch (or staging environment) to deploy
--totextoptional
Deploy into this staging environment instead of production
--yes / -yflagoptional
Deploy without asking
--accept-violationsflagoptional
Deploy even though the access simulation found new write access
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches reset

Make a branch's database again from the one it started from (its parent branch, else production), with the same data option (sample/all rows are copied again, masked as before).

sov branches reset [OPTIONS] NAME

A backup is taken first; its functions and policies are kept.

Arguments and options

NAMEtextrequired
Branch to reset
--yes / -yflagoptional
Reset without asking
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches restore

Put a branch's database back as it was at a moment (point-in-time, within the plan's window).

sov branches restore [OPTIONS] NAME

Production is never touched; a backup of the branch is taken first.

Arguments and options

NAMEtextrequired
Branch whose database to restore
--attextrequired
ISO time to go back to, e.g. 2026-10-26T10:00:00Z
--yes / -yflagoptional
Restore without asking
--wait / --no-waitflagoptional
Wait for the restore to finish
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches protect

Protect a branch: it can't be deleted, reset or restored until protection is turned off (plan env.protection).

sov branches protect [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Branch to protect
--offflagoptional
Turn protection off
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches expire

Delete a branch automatically after --days (never a protected one), or --never to keep it.

sov branches expire [OPTIONS] NAME

Arguments and options

NAMEtextrequired
Branch to give an end date
--daysint rangeoptional
Delete it automatically after this many days
--neverflagoptional
Remove the end date
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov branches revert

Go back to a commit on one branch: policies, settings, functions and buckets are put back in that branch's own environment with your permissions; migrations and the database only when asked.

sov branches revert [OPTIONS] AT

Recorded as new commits.

Arguments and options

ATtextrequired
Commit id or ISO time to go back to (see the console's Version history)
--branch / -btextoptionaldefault production
Branch to revert (default production / main)
--include-schemaflagoptional
Also roll back migrations applied since then
--include-databaseflagoptional
Also restore the database as of then
--yes / -yflagoptional
Revert without asking
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.