PostgreSQL query tool for pi with SSH tunnel support and named profiles.
pi install git:github.com/Complead/pgqOr from local path:
pi install /path/to/pgqAfter installation, create your profiles:
mkdir -p ~/.config/pgqEdit ~/.config/pgq/profiles.json:
{
"profiles": {
"production": {
"dsn": "postgres://user:pass@localhost:25063/mydb?sslmode=require",
"tunnel": "25063:db-host.com:5432 devops@bastion -i ~/.ssh/id_rsa"
},
"local": {
"dsn": "postgres://postgres:postgres@localhost:5432/mydb?sslmode=disable",
"tunnel": ""
}
}
}Just ask pi to query your database:
"show me the latest 10 tasks in flashpoint"
Pi will use the pgq skill to pick the right profile and run the query.
pgq --profile production "SELECT count(*) FROM users"
pgq --profile local --format json "SELECT * FROM tasks LIMIT 5"
pgq --profiles # list configured profilesgo build -o pgq .
./pgq --helpTag and push to trigger binary builds:
git tag v0.1.0
git push origin v0.1.0GitHub Actions builds binaries for linux/darwin/windows (amd64+arm64) and attaches them to the release. The postinstall script downloads the correct binary when users install the package.