PgBeam Docs
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

OptionDescriptionRequiredDefault
--host <value>Hostname or IP address of the PostgreSQL serverNo-
--port <value>Port number of the PostgreSQL serverNo5432
--name <value>Name of the database on the serverNo-
--username <value>Username for authenticating with the databaseNo-
--password <value>Password for authenticating with the databaseNo-
--ssl-mode <value>SSL connection mode: disable, require, verify-ca, or verify-fullNo-

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 --json

Output

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.

On this page