Platform
CLI reference

ccp db

View as Markdown

Manage databases

Usage: ccp db [OPTIONS] <COMMAND>
ArgumentType or valuesDefaultParser environment variableDescription
--help, -hflag——Print help

ccp db create

Create a database

Usage: ccp db create [OPTIONS]
ArgumentType or valuesDefaultParser environment variableDescription
--typepostgres, sqlite——Database type (prompts in a terminal, defaults to postgres in scripts)
--nametext——Postgres database name
--app, --app-idtext——App ID to bind to the managed database. Auto-detected from the active project config if not provided
--org-idtext——Postgres organization ID (defaults to the linked project, CCP_ORG_ID, or picker)
--networktext——Private overlay network for Postgres
--help, -hflag——Print help

ccp db attach-network

Attach an existing running database to its first private network

Usage: ccp db attach-network [OPTIONS] <NETWORK>
ArgumentType or valuesDefaultParser environment variableDescription
networktext——Organization-scoped network name
--db-idtext——Database ID (defaults to the active project)
--help, -hflag——Print help

ccp db list

List Postgres and SQLite databases in an organization

Usage: ccp db list [OPTIONS]

Aliases: ls.

ArgumentType or valuesDefaultParser environment variableDescription
--org-idtext——Organization ID (defaults to the linked project, CCP_ORG_ID, or picker)
--jsonflagfalse—Emit complete, unstyled JSON
--help, -hflag——Print help

ccp db get

Show database details

Usage: ccp db get [OPTIONS] [DB_ID]
ArgumentType or valuesDefaultParser environment variableDescription
--jsonflagfalse—Emit structured JSON on stdout
db_idtext——Database ID (defaults to the project config or .env HTTP database)
--help, -hflag——Print help

ccp db delete

Delete a Postgres database or a detached SQLite database

Usage: ccp db delete [OPTIONS] <DB_ID>

Aliases: rm.

ArgumentType or valuesDefaultParser environment variableDescription
db_idtext——Database ID
--yes, -yflagfalse—Skip confirmation prompt
--help, -hflag——Print help

ccp db migrate

Run SQL migrations against a database

Usage: ccp db migrate [OPTIONS]
ArgumentType or valuesDefaultParser environment variableDescription
--dirpath./migrations—Migrations directory (default: ./migrations)
--db-idtext——Database ID (reads from the active project config if omitted)
--tokentext——Database token (reads from the active project config if omitted)
--statusflagfalse—Show migration status without applying
--help, -hflag——Print help

ccp db connect

Open an interactive SQL shell

Usage: ccp db connect [OPTIONS]
ArgumentType or valuesDefaultParser environment variableDescription
--db-idtext——Database ID (reads from the active project config if omitted)
--tokentext——Database token (reads from the active project config if omitted)
--help, -hflag——Print help

ccp db exec

Execute a SQL statement

Usage: ccp db exec [OPTIONS] <SQL>
ArgumentType or valuesDefaultParser environment variableDescription
--jsonflagfalse—Emit structured JSON on stdout
sqltext——SQL to execute
--db-idtext——Database ID (reads from the active project config if omitted)
--tokentext——Database token (reads from the active project config if omitted)
--help, -hflag——Print help

ccp db backup

Manage database backups

Usage: ccp db backup [OPTIONS] <COMMAND>
ArgumentType or valuesDefaultParser environment variableDescription
--help, -hflag——Print help

ccp db backup create

Create a manual backup

Usage: ccp db backup create [OPTIONS]
ArgumentType or valuesDefaultParser environment variableDescription
--db-idtext——Database ID (reads from the active project config if omitted)
--help, -hflag——Print help

ccp db backup list

List backups for a database

Usage: ccp db backup list [OPTIONS]

Aliases: ls.

ArgumentType or valuesDefaultParser environment variableDescription
--jsonflagfalse—Emit a JSON array of backups
--db-idtext——Database ID (reads from the active project config if omitted)
--help, -hflag——Print help

ccp db backup restore

Restore a database from a backup

Usage: ccp db backup restore [OPTIONS] <BACKUP_ID>
ArgumentType or valuesDefaultParser environment variableDescription
backup_idtext——Backup ID to restore from
--db-idtext——Database ID (reads from the active project config if omitted)
--yes, -yflagfalse—Skip confirmation prompt
--help, -hflag——Print help

ccp db backup delete

Delete a backup

Usage: ccp db backup delete [OPTIONS] <BACKUP_ID>

Aliases: rm.

ArgumentType or valuesDefaultParser environment variableDescription
backup_idtext——Backup ID to delete
--db-idtext——Database ID (reads from the active project config if omitted)
--yes, -yflagfalse—Skip confirmation prompt
--help, -hflag——Print help

ccp db client-access

Toggle client-access (JWT + anon auth) on a database

Usage: ccp db client-access [OPTIONS] <COMMAND>
ArgumentType or valuesDefaultParser environment variableDescription
--help, -hflag——Print help

ccp db client-access enable

Enable client-access (JWT + anon auth) on a database

Usage: ccp db client-access enable [OPTIONS] [DB_ID]
ArgumentType or valuesDefaultParser environment variableDescription
db_idtext——Database ID (reads from the active project config if omitted)
--help, -hflag——Print help

ccp db client-access disable

Disable client-access on a database (restore master-token-only auth)

Usage: ccp db client-access disable [OPTIONS] [DB_ID]
ArgumentType or valuesDefaultParser environment variableDescription
db_idtext——Database ID (reads from the active project config if omitted)
--help, -hflag——Print help

Example

ccp db list

Global options

Set CCP_CONTEXT to choose a named context. An explicit --context takes precedence. See organization selection for organization defaults.

ArgumentType or valuesDefaultParser environment variableDescription
--contexttext——Select a developer context from ~/.ccp/config.toml

On this page