db
db add
Add a database connection
Add a new database connection to the linked project. PgBeam will use these
credentials to connect to your upstream PostgreSQL server. Without flags, the
command runs interactively and prompts for all required values. After adding,
use pgbeam db test to verify connectivity.
Usage
pgbeam db add [flags]Options
| Option | Description | Required | Default |
|---|---|---|---|
--host <value> | Hostname or IP address of the PostgreSQL server | No | - |
--port <value> | Port number of the PostgreSQL server | No | 5432 |
--name <value> | Name of the database on the server | No | - |
--username <value> | Username for authenticating with the database | No | - |
--password <value> | Password for authenticating with the database | No | - |
--ssl-mode <value> | SSL connection mode: disable, require, verify-ca, or verify-full | No | - |
Global options
All global options (--token, --profile,
--project, --org, --json, --no-color, --debug) are also available on
this command.
Examples
# Interactive database setup
pgbeam db add
# Add with all flags
pgbeam db add --host db.example.com --port 5432 --name mydb --username admin --password secret --ssl-mode require
# Add and get result as JSON
pgbeam db add --host db.example.com --name mydb --username admin --password secret --jsonOutput
Prints the new database ID, name, and host:port. Suggests running
pgbeam db test <id> to verify the connection. With --json, returns the full
database object.