← ClaudeAtlas

postgreslisted

Read-only PostgreSQL database querying, schema introspection, and query planning. Use when the user asks to query a database, look up data, check a table, describe a schema, list tables, show indexes, explain a query plan, or any other read-only PostgreSQL interaction. Triggers on requests like "query the users table", "show me the schema", "what tables are in staging", "run this SQL", "describe the orders table", "check the database", "how many rows in X", "explain this query".
dversoza/claude-skills · ★ 2 · API & Backend · score 56
Install: claude install-skill dversoza/claude-skills
# Postgres Read-only access to PostgreSQL databases via `psql`. All connections enforce `default_transaction_read_only=on` at the server level -- writes and DDL are rejected by PostgreSQL itself. ## Connection Setup The script resolves database aliases from a `` ```pg-databases``` `` fenced code block in the project's `CLAUDE.local.md`. It searches from the current working directory upward. Credentials never appear on the command line -- only the alias is passed as an argument. To discover available aliases: ```bash python3 ~/.claude/skills/postgres/scripts/pg_query.py list ``` If no `CLAUDE.local.md` exists or it has no `pg-databases` block, ask the user for connection details and suggest they add a block like this to their project's `CLAUDE.local.md`: ````markdown ```pg-databases staging=postgres://user:pass@staging-host:5432/myapp local=postgres://localhost:5432/myapp_dev analytics=postgres://analyst:pass@analytics-host:5432/warehouse ``` ```` Remind the user that `CLAUDE.local.md` should be in `.gitignore` to keep credentials out of version control. Do NOT pass connection URIs on the command line. Always use the alias. ## Subcommands All subcommands take a database alias as the first argument. ### Introspection ```bash python3 ~/.claude/skills/postgres/scripts/pg_query.py schemas staging # list non-system schemas python3 ~/.claude/skills/postgres/scripts/pg_query.py tables staging # list tables in public schema python3 ~