projectsreplicas
replicas add
Add a read replica
Add a read replica to a database connection. PgBeam can route read-only queries
to replicas for improved performance and load distribution. Without the --host
flag, the command prompts for the replica hostname interactively.
Usage
pgbeam replicas add [flags]Options
| Option | Description | Required | Default |
|---|---|---|---|
--database-id <value> | ID of the database to add the replica to | Yes | - |
--host <value> | Hostname or IP address of the replica server | No | - |
--port <value> | Port number of the replica server | No | 5432 |
--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
# Add a replica interactively
pgbeam replicas add --database-id db_xxx
# Add a replica with all flags
pgbeam replicas add --database-id db_xxx --host replica.example.com --port 5432 --ssl-mode requireOutput
Prints the new replica ID. With --json, returns the full replica object.