सामग्री पर जाएँ
ऑराबेस लोगो
aurabase

Database CLI reference

Usage, arguments and options of each `aura` command that works on your database, read from the help of the binary itself

संदर्भ22 मि॰ पढ़ेंस्तर संदर्भ

यह पेज अभी तक आपकी भाषा में उपलब्ध नहीं है. इसे अंग्रेजी में दिखाया गया है.

This page is generated from the aura binary (npm run docs:cli in studio/): every usage line, argument and option below is the output of aura <command> --help. Square brackets mark optional items, angle brackets mark values you provide.

Every command also accepts --help and --gateway-url <URL>: Management plane URL (default: https://api.aurabase.cloud). Local: http://localhost:8090. Equivalent to the AURA_GATEWAY_URL environment variable.

aura db#

Manage the database (migrations, SDK, schema)

aura db [OPTIONS] <COMMAND>
CommandDescription
aura db migrationManage migrations
aura db tableManage tables (schema)
aura db pushApply local migrations (+ remote sync if a project is linked)
aura db pullPull remote schema
aura db watchWatch for changes and sync
aura db resetReset the database (purge and recreate) — DESTRUCTIVE, asks for confirmation
aura db seedInsert test data (seed.sql), or an example schema with --example
aura db generateGenerate types (TypeScript/JS or Rust)
aura db statusShow migration status
aura db slow-queriesMost expensive SQL queries in the project (pg_stat_statements)
aura db statsConnections and database size for the project
aura db diffCompare remote schema and generate a diff migration
aura db rawExecute raw SQL directly
aura db policyManage RLS policies
aura db functionManage project Postgres SQL functions (PL/pgSQL, SQL)
aura db triggerManage Postgres triggers on a table
aura db backupManage database backups
aura db inspectDiagnostics the SQL guard does not allow in raw queries: index usage, table sizes, blocking locks
aura db connectionDirect PostgreSQL access (psql, Prisma, Drizzle, pg_dump): host, role and a one-time password
aura db extensionsList or enable PostgreSQL extensions of the linked project
aura db api-keysManage project API keys
aura db restoreRestore a plain-SQL pg_dump file (statements, $$ bodies, COPY blocks) into the project

aura db migration#

Manage migrations

aura db migration [OPTIONS] <COMMAND>
CommandDescription
aura db migration newCreate a new migration
aura db migration listList all migrations and their status
aura db migration downRevert the last N applied migrations (default: 1)
aura db migration repairManually mark a migration as applied or reverted

aura db migration new#

Create a new migration

aura db migration new [OPTIONS] <NAME>
ArgumentDescription
<NAME>

aura db migration list#

List all migrations and their status

aura db migration list [OPTIONS]
OptionDescription
--json

aura db migration down#

Revert the last N applied migrations (default: 1)

aura db migration down [OPTIONS] [N]
ArgumentDescription
[N][default: 1]

aura db migration repair#

Manually mark a migration as applied or reverted

aura db migration repair [OPTIONS] <NAME>
ArgumentDescription
<NAME>Migration file name (e.g. 20240101_create_users.sql)
OptionDescription
--appliedMark as applied
--revertedMark as reverted

aura db table#

Manage tables (schema)

aura db table [OPTIONS] <COMMAND>
CommandDescription
aura db table listList tables and their columns
aura db table createCreate a table e.g. aura db table create users "name:text,email:text,age:int"
aura db table dropDrop a table
aura db table rlsEnable or disable Row Level Security
aura db table realtimeEnable or disable Realtime CDC

aura db table list#

List tables and their columns

aura db table list [OPTIONS]
OptionDescription
--json

aura db table create#

Create a table e.g. aura db table create users "name:text,email:text,age:int"

aura db table create [OPTIONS] <NAME> [COLUMNS]
ArgumentDescription
<NAME>Table name
[COLUMNS]Columns in "name:type,..." format (see --help for all 16 supported types)

aura db table drop#

Drop a table

aura db table drop [OPTIONS] <NAME>
ArgumentDescription
<NAME>Table name
OptionDescription
-f, --forceDrop without asking for confirmation

aura db table rls#

Enable or disable Row Level Security

aura db table rls [OPTIONS] <NAME> <STATE>
ArgumentDescription
<NAME>Table name
<STATE>on | off

aura db table realtime#

Enable or disable Realtime CDC

aura db table realtime [OPTIONS] <NAME> <STATE>
ArgumentDescription
<NAME>Table name
<STATE>on | off

aura db push#

Apply local migrations (+ remote sync if a project is linked)

aura db push [OPTIONS]

aura db pull#

Pull remote schema

aura db pull [OPTIONS]

aura db watch#

Watch for changes and sync

aura db watch [OPTIONS]

aura db reset#

Reset the database (purge and recreate) — DESTRUCTIVE, asks for confirmation

aura db reset [OPTIONS]
OptionDescription
-f, --forceSkip the confirmation prompt

aura db seed#

Insert test data (seed.sql), or an example schema with --example

aura db seed [OPTIONS]
OptionDescription
--example <NAME>Install an embedded example schema instead of seed.sql (available: docs)

aura db generate#

Generate types (TypeScript/JS or Rust)

aura db generate [OPTIONS]
OptionDescription
--lang <LANG>Output language: ts (default) | rust [default: ts] [possible values: ts, rust]

aura db status#

Show migration status

aura db status [OPTIONS]
OptionDescription
--json

aura db slow-queries#

Most expensive SQL queries in the project (pg_stat_statements)

aura db slow-queries [OPTIONS]
OptionDescription
--limit <LIMIT>Number of queries to display [default: 10]
--json

aura db stats#

Connections and database size for the project

aura db stats [OPTIONS]
OptionDescription
--json

aura db diff#

Compare remote schema and generate a diff migration

aura db diff [OPTIONS]
OptionDescription
--name <NAME>Name of the generated migration (default: schema_diff)

aura db raw#

Execute raw SQL directly

aura db raw [OPTIONS] [SQL]
ArgumentDescription
[SQL]SQL query to execute (use - to read it from stdin). May start with a -- comment
OptionDescription
-f, --file <FILE>Read the SQL from a file instead of the command line
-p, --params [<PARAMS>...]Positional parameters ($1, $2...) to bind
--jsonRaw JSON output
--dry-runActually run the query then ROLL BACK the transaction (dry run). Constraint errors still surface and rows are returned, but nothing is committed
--read-onlyExecute inside a READ-ONLY transaction — PostgreSQL rejects any write at the engine level (this flag can only restrict)
--as <AS_ROLE>Execute the query as an anonymous visitor (anon) or application user (authenticated, with --user) instead of admin: verifies an RLS policy as the application would see it. Can only restrict [possible values: anon, authenticated]
--user <AS_USER>UUID of the impersonated user (auth.uid()), required with --as authenticated

aura db policy#

Manage RLS policies

aura db policy [OPTIONS] <COMMAND>
CommandDescription
aura db policy listList RLS policies
aura db policy addCreate an RLS policy
aura db policy updateUpdate expressions on an existing RLS policy (ALTER POLICY)
aura db policy deleteDelete an RLS policy

aura db policy list#

List RLS policies

aura db policy list [OPTIONS]
OptionDescription
--table <TABLE>
--allInclude system/storage internal policies
--json

aura db policy add#

Create an RLS policy

aura db policy add [OPTIONS] <TABLE> <NAME> <CMD>
ArgumentDescription
<TABLE>
<NAME>
<CMD>
OptionDescription
--using-expr <USING_EXPR>
--check-expr <CHECK_EXPR>

aura db policy update#

Update expressions on an existing RLS policy (ALTER POLICY)

aura db policy update [OPTIONS] <TABLE> <NAME>
ArgumentDescription
<TABLE>
<NAME>
OptionDescription
--using-expr <USING_EXPR>
--check-expr <CHECK_EXPR>

aura db policy delete#

Delete an RLS policy

aura db policy delete [OPTIONS] <TABLE> <NAME>
ArgumentDescription
<TABLE>
<NAME>
OptionDescription
-f, --force

aura db function#

Manage project Postgres SQL functions (PL/pgSQL, SQL)

aura db function [OPTIONS] <COMMAND>
CommandDescription
aura db function listList Postgres functions in the project schema (name, arguments, security, GRANT)
aura db function createCreate or replace a Postgres function
aura db function dropDrop a Postgres function

aura db function list#

List Postgres functions in the project schema (name, arguments, security, GRANT)

aura db function list [OPTIONS]
OptionDescription
--json

aura db function create#

Create or replace a Postgres function

aura db function create [OPTIONS] <NAME>
ArgumentDescription
<NAME>Function name (ASCII alphanumeric and '_' — no silent sanitization)
OptionDescription
-b, --body <BODY>Function body (SQL or PL/pgSQL, without enclosing $$)
--body-file <BODY_FILE>File containing the function body (alternative to --body)
--returns <RETURNS>Postgres return type (e.g. void, text, trigger, setof uuid, numeric(10,2)) [default: void]
--language <LANGUAGE>Language: plpgsql | sql [default: plpgsql]
--args <ARGS>Arguments in "name:type,name2:type2" format (IN mode only)
--security <SECURITY>Security mode: invoker (server default) | definer
--grant-execute-to <GRANT_EXECUTE_TO>Roles allowed to EXECUTE (repeatable, or comma-separated)

aura db function drop#

Drop a Postgres function

aura db function drop [OPTIONS] <NAME>
ArgumentDescription
<NAME>
OptionDescription
-f, --force

aura db trigger#

Manage Postgres triggers on a table

aura db trigger [OPTIONS] <COMMAND>
CommandDescription
aura db trigger listList triggers on a table
aura db trigger createCreate a trigger on a table
aura db trigger dropDrop a trigger from a table

aura db trigger list#

List triggers on a table

aura db trigger list [OPTIONS] <TABLE>
ArgumentDescription
<TABLE>Table name
OptionDescription
--json

aura db trigger create#

Create a trigger on a table

aura db trigger create [OPTIONS] --function <FUNCTION_NAME> --events <EVENTS> <TABLE> <NAME>
ArgumentDescription
<TABLE>Table name owning the trigger
<NAME>Trigger name
OptionDescription
--function <FUNCTION_NAME>Postgres function to execute (created via aura db function create, RETURNS trigger)
--timing <TIMING>Timing: before | after | instead_of [default: before]
--events <EVENTS>Events: insert | update | delete | truncate (repeatable or comma-separated)
--for-each <FOR_EACH>Granularity: row | statement (truncate requires statement) [default: row]

aura db trigger drop#

Drop a trigger from a table

aura db trigger drop [OPTIONS] <TABLE> <NAME>
ArgumentDescription
<TABLE>Table name
<NAME>Trigger name
OptionDescription
-f, --force

aura db backup#

Manage database backups

aura db backup [OPTIONS] <COMMAND>
CommandDescription
aura db backup listList backups
aura db backup createCreate a backup
aura db backup restoreRestore from a backup (overwrites current data; --verify-only replays it in a rolled-back transaction)
aura db backup downloadDownload a backup's SQL dump
aura db backup deleteDelete a backup
aura db backup scheduleView or configure the AUTOMATIC backup schedule

aura db backup list#

List backups

aura db backup list [OPTIONS]
OptionDescription
--json

aura db backup create#

Create a backup

aura db backup create [OPTIONS]
OptionDescription
--label <LABEL>

aura db backup restore#

Restore from a backup (overwrites current data; --verify-only replays it in a rolled-back transaction)

aura db backup restore [OPTIONS] <ID>
ArgumentDescription
<ID>
OptionDescription
--verify-onlyReplay the backup in a transaction that is rolled back: nothing is modified
-y, --yesSkip the confirmation prompt (required without a terminal) [alias: --force]

aura db backup download#

Download a backup's SQL dump

aura db backup download [OPTIONS] <ID>
ArgumentDescription
<ID>
OptionDescription
-o, --output <OUTPUT>

aura db backup delete#

Delete a backup

aura db backup delete [OPTIONS] <ID>
ArgumentDescription
<ID>
OptionDescription
-f, --force

aura db backup schedule#

View or configure the AUTOMATIC backup schedule

aura db backup schedule [OPTIONS] <COMMAND>
CommandDescription
aura db backup schedule getShow the automatic backup schedule
aura db backup schedule setConfigure the automatic backup schedule

aura db backup schedule get#

Show the automatic backup schedule

aura db backup schedule get [OPTIONS]
OptionDescription
--json

aura db backup schedule set#

Configure the automatic backup schedule

aura db backup schedule set [OPTIONS]
OptionDescription
--frequency <FREQUENCY>Frequency: hourly | daily | weekly
--retention-days <RETENTION_DAYS>Retention in days (integer > 0)
--enableEnable automatic backups
--disableDisable automatic backups

aura db inspect#

Diagnostics the SQL guard does not allow in raw queries: index usage, table sizes, blocking locks

aura db inspect [OPTIONS] <KIND>
ArgumentDescription
<KIND>What to inspect [possible values: indexes, tables, locks]
OptionDescription
--json

aura db connection#

Direct PostgreSQL access (psql, Prisma, Drizzle, pg_dump): host, role and a one-time password

aura db connection [OPTIONS]
OptionDescription
--new-passwordIssue a new password and print the connection string (revokes the current password)
--yesDo not ask for confirmation before replacing an existing password
--jsonRaw JSON output

aura db extensions#

List or enable PostgreSQL extensions of the linked project

aura db extensions [OPTIONS] <COMMAND>
CommandDescription
aura db extensions listList installed extensions
aura db extensions enableEnable an allowed extension (pgcrypto, uuid-ossp, pg_trgm, citext, hstore, ltree, unaccent, vector, pg_graphql, btree_gin, btree_gist, fuzzystrmatch, intarray, pg_stat_statements)

aura db extensions list#

List installed extensions

aura db extensions list [OPTIONS]
OptionDescription
--json

aura db extensions enable#

Enable an allowed extension (pgcrypto, uuid-ossp, pg_trgm, citext, hstore, ltree, unaccent, vector, pg_graphql, btree_gin, btree_gist, fuzzystrmatch, intarray, pg_stat_statements)

aura db extensions enable [OPTIONS] <NAME>
ArgumentDescription
<NAME>Extension name

aura db api-keys#

Manage project API keys

Alias: apikeys

aura db api-keys [OPTIONS] <COMMAND>
CommandDescription
aura db api-keys listList API keys
aura db api-keys createCreate a new API key
aura db api-keys revokeRevoke an API key

aura db api-keys list#

List API keys

aura db api-keys list [OPTIONS]
OptionDescription
--json

aura db api-keys create#

Create a new API key

aura db api-keys create [OPTIONS] <NAME>
ArgumentDescription
<NAME>
OptionDescription
--scope <SCOPE>Scope: anon | authenticated | service_role [default: anon]

aura db api-keys revoke#

Revoke an API key

aura db api-keys revoke [OPTIONS] <ID>
ArgumentDescription
<ID>
OptionDescription
-f, --force

aura db restore#

Restore a plain-SQL pg_dump file (statements, $$ bodies, COPY blocks) into the project

aura db restore [OPTIONS] <FILE>
ArgumentDescription
<FILE>SQL file (.sql) to restore
OptionDescription
-f, --forceForce overwrite or execution without interactive confirmation
--from <N>Resume at item N of the dump (as printed after an error) [default: 1]
--continue-on-errorKeep going after a failed item instead of stopping
--source-schema <SOURCE_SCHEMA>Schema qualifier written by pg_dump, removed so objects land in the project schema [default: public]
--dry-runParse the dump and print the plan without executing anything

aura connect#

Open an interactive psql console

aura connect [OPTIONS]

aura migration#

Manage SQL migrations (same commands as aura db migration)

aura migration [OPTIONS] <COMMAND>
CommandDescription
aura migration newCreate a new migration
aura migration listList all migrations and their status
aura migration downRevert the last N applied migrations (default: 1)
aura migration repairManually mark a migration as applied or reverted

aura migration new#

Create a new migration

aura migration new [OPTIONS] <NAME>
ArgumentDescription
<NAME>

aura migration list#

List all migrations and their status

aura migration list [OPTIONS]
OptionDescription
--json

aura migration down#

Revert the last N applied migrations (default: 1)

aura migration down [OPTIONS] [N]
ArgumentDescription
[N][default: 1]

aura migration repair#

Manually mark a migration as applied or reverted

aura migration repair [OPTIONS] <NAME>
ArgumentDescription
<NAME>Migration file name (e.g. 20240101_create_users.sql)
OptionDescription
--appliedMark as applied
--revertedMark as reverted

aura migrate#

Third-party migration and import/export tools (e.g. Supabase)

aura migrate [OPTIONS] <COMMAND>
CommandDescription
aura migrate export-supabaseExport users (password hashes, OAuth identities) and a pg_dump of the public schema from a Supabase project, for aura auth import and aura db restore

aura migrate export-supabase#

Export users (password hashes, OAuth identities) and a pg_dump of the public schema from a Supabase project, for aura auth import and aura db restore

aura migrate export-supabase [OPTIONS]
OptionDescription
--db-url <DB_URL>Direct PostgreSQL connection string to Supabase (e.g. postgresql://postgres:password@db.xxx.supabase.co:5432/postgres)
--output-dir <OUTPUT_DIR>Destination directory for exported files (default: ./supabase-export) [default: ./supabase-export]

aura projects create#

Create a new project in an organization

aura projects create [OPTIONS] <NAME>
ArgumentDescription
<NAME>Project name
OptionDescription
--engine <ENGINE>Engine (postgres | mongodb, default postgres)
--org <ORG>Organization slug (default: default_org_slug from config)
--no-waitDo not wait for provisioning to finish (follow later with aura projects wait <id>)
--jsonJSON output (id, slug, url, anon_key, service_role_key) for scripting/CI
--timeout <TIMEOUT>Maximum provisioning timeout, in seconds [default: 300]

aura branch#

Create, list and delete database branches (a copy of a project, with its own URL and keys)

aura branch [OPTIONS] <COMMAND>
CommandDescription
aura branch createCreate a branch: a new project cloned from a PostgreSQL project (schema, RLS policies, functions, triggers, views and, unless --no-data, the rows)
aura branch listList the branches of a project (or of the whole organization with --all)
aura branch deleteDelete a branch and its database

aura branch create#

Create a branch: a new project cloned from a PostgreSQL project (schema, RLS policies, functions, triggers, views and, unless --no-data, the rows)

aura branch create [OPTIONS] <NAME>
ArgumentDescription
<NAME>Branch name (letters, digits, . _ - /; up to 63 characters)
OptionDescription
--from <FROM>Source project: id, slug or name (default: the linked project)
--org <ORG>Organization slug, to resolve --from by name (default: default_org_slug from config)
--ttl <TTL>Time to live: 72h, 3d, 2w... between 1h and 30d (default 72h)
--no-dataClone the schema only, without any row
--no-waitDo not wait for the clone to finish (follow it with aura branch list)
--jsonJSON output (id, slug, url, anon_key, service_role_key, expires_at) for scripting/CI
--timeout <TIMEOUT>Maximum wait, in seconds [default: 900]

aura branch list#

List the branches of a project (or of the whole organization with --all)

aura branch list [OPTIONS]
OptionDescription
--from <FROM>Source project: id, slug or name (default: the linked project)
--org <ORG>Organization slug (default: default_org_slug from config)
--allList every branch of the organization
--jsonRaw JSON output (for scripting/CI)

aura branch delete#

Delete a branch and its database

aura branch delete [OPTIONS] <NAME>
ArgumentDescription
<NAME>Branch name
OptionDescription
--from <FROM>Source project: id, slug or name (default: the linked project)
--org <ORG>Organization slug (default: default_org_slug from config)
-f, --forceSkip the confirmation prompt

aura advisor#

Run security and architecture advisor audit (CI/CD check)

aura advisor [OPTIONS] <COMMAND>
CommandDescription
aura advisor auditRun security and architecture audits

aura advisor audit#

Run security and architecture audits

aura advisor audit [OPTIONS]
OptionDescription
--strictFail with non-zero exit code if critical security issues are detected
--jsonRaw JSON output (for scripting/CI)