Docs

CLI: Database, documents and schema

Run SQL, manage tables and migrations, read and write documents, inspect the schema and generate types with sov.

Updated Oct 16, 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 Atlas-Rel.

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 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 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)
  • 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 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
  • 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
  • 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.

Arguments and options

--dirtextoptional
Migration directory (default: sovaria/migrations under linked project)
--dry-runflagoptional
Run each pending migration in a transaction and roll it back (nothing is kept)
  • 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 data

Atlas-Doc and Atlas-Rel 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
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov data doc-scan

Scan Atlas-Doc by prefix/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 SQL query through Atlas-Rel.

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
  • 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 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

Arguments and options

LANGtextrequired
typescript | python | ts | py
--output / -opathoptional
Write to file instead of stdout
  • 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.
Something unclear or missing on this page?Tell us