Skip to main content

tunnel

open a local port to a database

Open an authenticated tunnel from 127.0.0.1 to a database, for GUI clients (TablePlus, DBeaver, pgAdmin, DataGrip), migrations and pg_dump.

For now, the database needs public access on with your IP address allowed (csph db public enable <name> --allow <your-ip>). The tunnel uses your CLI login and project access, and every connection is recorded. It runs until you press Ctrl-C. By default it goes to the primary directly ("for tools and migrations"); --pooled goes through the connection pooler ("for your app").

Usage​

csph db tunnel <name|id> [flags]

Options​

Command Specific​

--environment <string>
environment ID
--pooled
go through the connection pooler instead of the primary

--port <int> (default 5432)

local port (0 picks a free one)
--project <string>
project ID
--quiet
don't log each connection
--reveal
include the password in the printed connection string

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 tunnel orders
csph db tunnel orders --port 6543 --pooled
csph db tunnel orders --reveal # print the password in the connection string

See also​