ccp db
Manage databases
Usage: ccp db [OPTIONS] <COMMAND>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --help, -h | flag | — | — | Print help |
ccp db create
Create a database
Usage: ccp db create [OPTIONS]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --type | postgres, sqlite | — | — | Database type (prompts in a terminal, defaults to postgres in scripts) |
| --name | text | — | — | Postgres database name |
| --app, --app-id | text | — | — | App ID to bind to the managed database. Auto-detected from the active project config if not provided |
| --org-id | text | — | — | Postgres organization ID (defaults to the linked project, CCP_ORG_ID, or picker) |
| --network | text | — | — | Private overlay network for Postgres |
| --help, -h | flag | — | — | Print help |
ccp db attach-network
Attach an existing running database to its first private network
Usage: ccp db attach-network [OPTIONS] <NETWORK>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| network | text | — | — | Organization-scoped network name |
| --db-id | text | — | — | Database ID (defaults to the active project) |
| --help, -h | flag | — | — | Print help |
ccp db list
List Postgres and SQLite databases in an organization
Usage: ccp db list [OPTIONS]Aliases: ls.
| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --org-id | text | — | — | Organization ID (defaults to the linked project, CCP_ORG_ID, or picker) |
| --json | flag | false | — | Emit complete, unstyled JSON |
| --help, -h | flag | — | — | Print help |
ccp db get
Show database details
Usage: ccp db get [OPTIONS] [DB_ID]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --json | flag | false | — | Emit structured JSON on stdout |
| db_id | text | — | — | Database ID (defaults to the project config or .env HTTP database) |
| --help, -h | flag | — | — | Print help |
ccp db delete
Delete a Postgres database or a detached SQLite database
Usage: ccp db delete [OPTIONS] <DB_ID>Aliases: rm.
| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| db_id | text | — | — | Database ID |
| --yes, -y | flag | false | — | Skip confirmation prompt |
| --help, -h | flag | — | — | Print help |
ccp db migrate
Run SQL migrations against a database
Usage: ccp db migrate [OPTIONS]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --dir | path | ./migrations | — | Migrations directory (default: ./migrations) |
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --token | text | — | — | Database token (reads from the active project config if omitted) |
| --status | flag | false | — | Show migration status without applying |
| --help, -h | flag | — | — | Print help |
ccp db connect
Open an interactive SQL shell
Usage: ccp db connect [OPTIONS]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --token | text | — | — | Database token (reads from the active project config if omitted) |
| --help, -h | flag | — | — | Print help |
ccp db exec
Execute a SQL statement
Usage: ccp db exec [OPTIONS] <SQL>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --json | flag | false | — | Emit structured JSON on stdout |
| sql | text | — | — | SQL to execute |
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --token | text | — | — | Database token (reads from the active project config if omitted) |
| --help, -h | flag | — | — | Print help |
ccp db backup
Manage database backups
Usage: ccp db backup [OPTIONS] <COMMAND>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --help, -h | flag | — | — | Print help |
ccp db backup create
Create a manual backup
Usage: ccp db backup create [OPTIONS]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --help, -h | flag | — | — | Print help |
ccp db backup list
List backups for a database
Usage: ccp db backup list [OPTIONS]Aliases: ls.
| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --json | flag | false | — | Emit a JSON array of backups |
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --help, -h | flag | — | — | Print help |
ccp db backup restore
Restore a database from a backup
Usage: ccp db backup restore [OPTIONS] <BACKUP_ID>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| backup_id | text | — | — | Backup ID to restore from |
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --yes, -y | flag | false | — | Skip confirmation prompt |
| --help, -h | flag | — | — | Print help |
ccp db backup delete
Delete a backup
Usage: ccp db backup delete [OPTIONS] <BACKUP_ID>Aliases: rm.
| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| backup_id | text | — | — | Backup ID to delete |
| --db-id | text | — | — | Database ID (reads from the active project config if omitted) |
| --yes, -y | flag | false | — | Skip confirmation prompt |
| --help, -h | flag | — | — | Print help |
ccp db client-access
Toggle client-access (JWT + anon auth) on a database
Usage: ccp db client-access [OPTIONS] <COMMAND>| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --help, -h | flag | — | — | 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]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| db_id | text | — | — | Database ID (reads from the active project config if omitted) |
| --help, -h | flag | — | — | 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]| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| db_id | text | — | — | Database ID (reads from the active project config if omitted) |
| --help, -h | flag | — | — | Print help |
Example
ccp db listGlobal options
Set CCP_CONTEXT to choose a named context. An explicit --context takes precedence. See organization selection for organization defaults.
| Argument | Type or values | Default | Parser environment variable | Description |
|---|---|---|---|---|
| --context | text | — | — | Select a developer context from ~/.ccp/config.toml |