The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: update cli db commands with detail descriptions
Qiao Han0df5f2321367
diff --git a/spec/cli_v1_commands.yaml b/spec/cli_v1_commands.yamlindex 05f64930410..7901e5cfab8 100644--- a/spec/cli_v1_commands.yaml+++ b/spec/cli_v1_commands.yaml@@ -1,7 +1,7 @@-elispec: '001'+clispec: '001'info:id: cli- version: 1.42.0+ version: 1.50.12title: Supabase CLIlanguage: shsource: https://github.com/supabase/cli@@ -405,6 +405,15 @@ commands:- id: supabase-test-dbtitle: supabase test dbsummary: Tests local database with pgTAP+ description: |2++ Executes pgTAP tests against the local database.++ Requires the local development stack to be started by running `supabase start`.++ Runs `pg_prove` in a container with unit test files volume mounted from `supabase/tests` directory. The test file can be suffixed by either `.sql` or `.pg` extension.++ Since each test is wrapped in its own transaction, it will be individually rolled back regardless of success or failure.tags: []links: []usage: supabase test db@@ -494,25 +503,25 @@ commands:subcommands: []flags:- id: output- name: -o, --output <[ env | json | pretty | toml | yaml ]>+ name: -o, --output <[ env | pretty | json | toml | yaml ]>description: Output format of status variables.default_value: prettyaccepted_values:- id: envname: env- type: '[ env | json | pretty | toml | yaml ]'- - id: json- name: json- type: '[ env | json | pretty | toml | yaml ]'+ type: '[ env | pretty | json | toml | yaml ]'- id: prettyname: pretty- type: '[ env | json | pretty | toml | yaml ]'+ type: '[ env | pretty | json | toml | yaml ]'+ - id: json+ name: json+ type: '[ env | pretty | json | toml | yaml ]'- id: tomlname: toml- type: '[ env | json | pretty | toml | yaml ]'+ type: '[ env | pretty | json | toml | yaml ]'- id: yamlname: yaml- type: '[ env | json | pretty | toml | yaml ]'+ type: '[ env | pretty | json | toml | yaml ]'- id: override-namename: --override-name <strings>description: Override specific variable names.@@ -563,7 +572,7 @@ commands:- id: excludename: -x, --exclude <strings>description: |- Names of containers to not start. [gotrue,realtime,storage-api,imgproxy,kong,inbucket,postgrest,pgadmin-schema-diff,migra,postgres-meta,studio,deno-relay]+ Names of containers to not start. [gotrue,realtime,storage-api,imgproxy,kong,inbucket,postgrest,pgadmin-schema-diff,migra,postgres-meta,studio,edge-runtime,logflare,vector]default_value: '[]'- id: ignore-health-checkname: --ignore-health-check@@ -759,6 +768,9 @@ commands:- id: us-west-1name: us-west-1type: string+ - id: us-west-2+ name: us-west-2+ type: string- id: supabase-orgstitle: supabase orgssummary: Manage Supabase organizations@@ -1089,19 +1101,19 @@ commands:name: Basic usagecode: supabase link --project-ref ********************response: |- Enter your database password: ********+ Enter your database password (or leave blank to skip): ********Finished supabase link.- id: without-passwordname: Link without database passwordcode: supabase link --project-ref ******************** <<< ""response: |- Enter your database password:+ Enter your database password (or leave blank to skip):Finished supabase link.- id: using-alternate-dnsname: Link using DNS-over-HTTPS resolvercode: supabase link --project-ref ******************** --dns-resolver httpsresponse: |- Enter your database password:+ Enter your database password (or leave blank to skip):Finished supabase link.tags:- local-dev@@ -1429,6 +1441,13 @@ commands:- id: supabase-db-resettitle: supabase db resetsummary: Resets the local database to current migrations+ description: |2++ Resets the local database to a clean state.++ Requires the local development stack to be started by running `supabase start`.++ Recreates the local Postgres container and applies all local migrations found in `supabase/migrations` directory. If test data is defined in `supabase/seed.sql`, it will be seeded after the migrations are run. Any other data or schema changes made during local development will be discarded.tags: []links: []usage: supabase db reset@@ -1469,6 +1488,17 @@ commands:- id: supabase-db-pushtitle: supabase db pushsummary: Push new migrations to the remote database+ description: |2++ Pushes all local migrations to a remote database.++ Requires your local project to be linked to a remote database by running `supabase link`. For self-hosted databases, you can pass in the connection parameters using `--db-url` flag.++ The first time this command is run, a migration history table will be created under `supabase_migrations.schema_migrations`. After successfully applying a migration, a new row will be inserted into the migration history table with timestamp as its unique id. Subsequent pushes will skip migrations that have already been applied.++ If you need to mutate the migration history table, such as deleting existing entries or inserting new entries without actually running the migration, use the `migration repair` command.++ Use the `--dry-run` flag to view the list of changes before applying.tags: []links: []usage: supabase db push [flags]@@ -1490,6 +1520,15 @@ commands:- id: supabase-db-linttitle: supabase db lintsummary: Checks local database for typing error+ description: |2++ Lints local database for schema errors.++ Requires the local development stack to be running when linting against the local database. To lint against a remote or self-hosted database, specify the `--linked` or `--db-url` flag respectively.++ Runs `plpgsql_check` extension in the local Postgres container to check for errors in all schemas. The default lint level is error and is configurable via the `--level` flag.++ To lint against specific schemas only, pass in the `--schema` flag.tags: []links: []usage: supabase db lint [flags]@@ -1517,6 +1556,15 @@ commands:- id: supabase-db-dumptitle: supabase db dumpsummary: Dumps data or schemas from the remote database+ description: |2++ Dumps contents from a remote database.++ Requires your local project to be linked to a remote database by running `supabase link`. For self-hosted databases, you can pass in the connection parameters using `--db-url` flag.++ Runs `pg_dump` in a container with additonal flags to exclude Supabase managed schemas. The ignored schemas include auth, stroage, and those created by extensions.++ The default dump does not contain any data or custom roles. To dump those contents explicitly, specify either the `--data-only` and `--role-only` flag.tags: []links: []usage: supabase db dump [flags]@@ -1545,6 +1593,21 @@ commands:- id: supabase-db-difftitle: supabase db diffsummary: Diffs the local database for schema changes+ description: |2++ Diffs schema changes made to the local or remote database.++ Requires the local development stack to be running when diffing against the local database. To diff against a remote or self-hosted database, specify the `--linked` or `--db-url` flag respectively.++ Runs [djrobstep/migra](https://github.com/djrobstep/migra) in a container to compare schema differences between the target database and a shadow database. The shadow database is created by applying migrations in local `supabase/migrations` directory in a separate container. Output is written to stdout by default. For convenience, you can also save the schema diff as a new migration file by passing in `-f` flag.++ By default, all schemas in the target database are diffed. Use the `--schema public,extensions` flag to restrict diffing to a subset of schemas.++ While the diff command is able to capture most schema changes, there are cases where it is known to fail. Currently, this could happen if you schema contains:++ - Changes to publication+ - Changes to storage buckets+ - Views with `security_invoker` attributestags: []links: []usage: supabase db diff [flags]@@ -1602,7 +1665,7 @@ commands:To load completions in your current shell session:- source <(supabase completion zsh); compdef _supabase supabase+ source <(supabase completion zsh)To load completions for every new session, execute once: