Psql Passthrough
graft psql opens a psql session on the infrastructure Postgres. It acts as a full psql passthrough — all native psql flags are supported.
Project Scope
Section titled “Project Scope”Inside a project directory, graft psql auto-connects to the environment’s linked database. No dbname argument is accepted — the database is always determined by the current env.
graft psql # interactive session on env's dbgraft psql -c "\dt" # list tablesgraft psql -c "SELECT count(*) FROM users"graft psql -f migrations/001.sql # run a SQL filegraft psql -t -A -c "SELECT version()" # any psql flags workgraft env staging psql # staging env's databasegraft env staging psql -c "\dt" # one-off on staginggraft -p myapp psql # specific project's prod dbRegistry Scope
Section titled “Registry Scope”With -r, connects to the admin master database by default, or to a specific database if provided.
graft -r azure psql # admin master dbgraft -r azure psql mydb # specific databasegraft -r azure psql mydb -c "SELECT 1"