Files
2dph/skills/postgres/SKILL.md
T
eSliderandGitHub 6b680bdb90
Tests / Test (push) Failing after 5s
Tests / Release (semver) (push) Skipped
feat: generate brain tools skill from OpenAPI; rename db-yaml to postgres (#21)
Cursor skills stay in lockstep with serve handlers. CI checks every bin/
path named in SKILL.md exists.
2026-08-13 21:32:57 +01:00

1.4 KiB

name, description
name description
postgres Read Postgres as compact YAML through bin/postgres/query.go (read-only guard, named profiles). Use when a task needs table contents, column types, or a SELECT against an ops database.

postgres

bin/postgres/query.go wraps vendored bin/db/psql-yq. Output is YAML (cheaper than psql ASCII, easy to slice with yq).

bin/postgres/query.go --profile onlyoffice -s document_asset   # column list
bin/postgres/query.go --profile onlyoffice -t task_result -l 20  # sample rows
bin/postgres/query.go --profile onlyoffice -c 'SELECT ...'     # query → YAML

Ad-hoc targets without a profile:

bin/postgres/query.go --container my-pg --db app -c 'SELECT 1'
bin/postgres/query.go --dsn 'postgres://user@host:5432/db' -c 'SELECT 1'

Profiles

Connection details live in $HOME/.config/brain/db-profiles.yml (mode 600), never in a project repo. A profile names either a container or a host; passwords are read from a separate password_env_file and never appear in argv.

Rules

  • Read-only. Any insert|update|delete|drop|truncate|alter|create|grant| revoke|vacuum|copy is rejected with exit 3. Do not work around it.
  • PII. Client CRM databases: aggregate and count freely; never copy names or addresses into chat, issues or docs.
  • Use -l to keep samples small. Twenty rows answer most questions.