Skip to main content

connection-string

print a connection string

Print a connection string for a database.

By default this is the pooled route, "for your app". Use --direct for the route "for tools and migrations" (session features such as LISTEN/NOTIFY and advisory locks, pg_dump, schema migrations). The hosts are private to the environment; from a laptop use csph db tunnel.

--public prints the public endpoint's string instead (only while csph db public is on), with sslmode=verify-full: the pooled route where the endpoint has one, otherwise the direct route; --direct for the direct route. Where the database's certificate comes from its own CA, the string carries sslrootcert=<file name>: --save-ca saves that CA file in the current directory (or --save-ca=<path>). Otherwise it uses sslrootcert=system, which needs libpq 16+; older libpq needs sslrootcert=<path to your CA bundle>.

Usage​

csph db connection-string <name|id> [flags]

Options​

Command Specific​

--direct
the direct route, for tools and migrations
--environment <string>
environment ID
--force
with --save-ca, overwrite a different file at that path
--pooled
the pooled route, for your app (the default)
--project <string>
project ID
--public
the public endpoint (only while public access is on)
--reveal
include the password (recorded in the activity log)
--save-ca <string>
save the public endpoint's CA file in the current directory, or at --save-ca=<path> (implies --public)

Formatting​

For more information about formatting options, see Formatting.

-o, --output <string>

output format: [table|plain|csv|json|yaml]

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

  csph db connection-string orders
csph db connection-string orders --direct --reveal
csph db connection-string orders --public --direct
csph db connection-string orders --public --save-ca

See also​