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
Inherited
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
- csph db — manage SphereDB databases
- csph db list — list databases
- csph db get — show a database
- csph db create — create a SphereDB database
- csph db delete — delete a database
- csph db instance-types — list database instance types and prices
- csph db resize — change a database's instance type, high availability or storage
- csph db connection-string — print a connection string
- csph db credentials — manage database credentials
- csph db connect — open psql on a database
- csph db public — manage the public endpoint (IP allowlist)