Commandscc db
cc db use
Set the active database for the current environment. Writes cc.database into the
editor's settings.json (picked up by launch.json's -d arg via
${config:cc.database}) and links the database to the active environment in cc's
records.
Usage
cc db use <name>
cc db use # pick from a list of matching databases
cc db use -p # pick from the environment's pool onlyArguments
| Argument | Description |
|---|---|
name | Database to set active (tab-completable). Omit to pick from a list. |
Flags
| Flag | Description |
|---|---|
-p, --pool | When prompting, show only databases linked to the current environment's pool |
What it does
- Requires an active project — switch to one first with
cc switch. - With no
name, shows a picker: by default, PostgreSQL databases matching the active project name; with-p, only the current environment's pool. Databases with a live-CC-COPYare marked with a ✓. - Writes the chosen database to
cc.databasein the version'ssettings.json. - Links it as the active database for the current environment.
Related
cc db— database group overviewcc db list— show the environment's databasescc db link/cc db unlink— manage the poolcc switch— switch the active environment