Wrapped pgx is a simple wrap on the PostgreSQL driver library pgx. It is used by sqlc, providing telementry for generated code.
- Pool: a wrapper of pgxpool.Pool. It manages a set of connection pools, including a primary pool and a set of replica pools. We assume replica pools are heterogeneous read-only replicas, meaning some replicas can be a partial copy of the primary database, using logical replication.
- WConn: a connection wrapper, implementing "WGConn".
- WTx: a transaction wrapper, implementing "WGConn".
- TestSuite: a comprehensive testing framework for PostgreSQL database tests.
This project includes a powerful test suite framework that supports two testing modes:
Connect to an existing PostgreSQL instance:
# Start PostgreSQL
make docker-postgres-start
# Run tests
make test
# Stop PostgreSQL
make docker-postgres-stopAutomatically manages PostgreSQL containers using testcontainers-go:
# Run tests with testcontainers (no manual setup needed!)
make test-containerBenefits:
- ✅ No manual PostgreSQL setup required
- ✅ Automatic container lifecycle management
- ✅ Perfect test isolation
- ✅ Works seamlessly in CI/CD (GitHub Actions, etc.)
- ✅ Only requires Docker to be running
USE_TEST_CONTAINERS=true- Enable testcontainers mode- See testsuite/README.md for detailed documentation
Two GitHub Actions workflows are provided:
- test-with-containers.yml - Uses testcontainers (recommended)
- go.yml - Uses GitHub Actions services (traditional)
For more details, see the TestSuite Documentation.