Repository navigation
pgGo v0.0.1
First release of pgGo: a tiny PostgreSQL client for AI agents, written in Go. It has zero dependencies, ships as one binary, speaks the PostgreSQL wire protocol directly, and prints JSON everywhere.
go install github.com/pgrundev/pggo/cmd/pggo@v0.0.1Commands
ping · info · query (read-only) · exec · bench · help · version
Built for agents
- Every response is one line of deterministic JSON on stdout.
- Errors are structured: a fixed set of types, the PostgreSQL SQLSTATE, a
retryableflag, anddetail/hint/position. - Queries take parameters via
--param/--params. pggo checks the number of$Nplaceholders before connecting. queryruns insideBEGIN READ ONLY … ROLLBACK, and each call accepts exactly one statement.- Every command has a timeout, and on expiry pggo cancels the statement on the server.
- Output is bounded by default (100 rows / 64 KB), and truncation is always reported explicitly.
- TLS supports
sslmodefromdisabletoverify-full. Login supports SCRAM-SHA-256, MD5 and cleartext passwords.
Verified
- Integration tests pass on PostgreSQL 16, 17, 18 and 19beta1. The same suites run in CI, alongside the unit, protocol and fuzz tests.
- Agent tests: Claude Sonnet passed 6/6 tasks with no instructions beyond "pggo is installed".
| pggo | pgx v5 (minimal) | psql | |
|---|---|---|---|
| binary | 4.0 MB (1.7 MB gzip) | 8.9 MB | 0.7 MB + libpq |
| connect + SELECT 1, p50 | 8.5 ms | 9.8 ms | 23.9 ms |
| peak RSS | 6.4 MiB | 9.0 MiB | 12.7 MiB |
The benchmark ran on macOS arm64 against PostgreSQL 18 in Docker. Warm query latency is the same as pgx within noise.
Binaries
Binaries for Linux and macOS, amd64 and arm64, are statically linked. checksums.txt holds their SHA-256 hashes.