Skip to content
SPECIFICTION
Get listed

pgtestdb

github.com

Free plan Self-hosted
Visit github.com
Spec score 7.3 #22 of 28 in Database Testing Tools

Spec sheet

Purpose
pgtestdb is a Go library for database-backed tests that provisions an isolated, migrated Postgres database for each test.Read 4 Oct 2026 · github.com
License
The repository identifies the project as MIT licensed.Read 4 Oct 2026 · github.com
Maker
The repository is maintained under the GitHub account peterldowns; the opened project page does not state a maker name, headquarters, or founding date.Read 4 Oct 2026 · github.com
Cleanup and debugging
Databases from passing tests are deleted automatically, while a failed test leaves its database available and logs a connection string for inspection.Read 4 Oct 2026 · github.com
Concurrency
Each test gets its own database, and the README says pgtestdb is concurrency-safe for parallel tests.Read 4 Oct 2026 · github.com
Database drivers
The library uses Go's database/sql interface and supports pgx, lib/pq, or another database/sql driver.Read 4 Oct 2026 · github.com
Database limits
The README notes that highly parallel test suites can exceed a Postgres server's connection limit and suggests tuning test parallelism or server capacity.Read 4 Oct 2026 · github.com
Default test role
The default role used for test databases has NOSUPERUSER, NOCREATEDB, and NOCREATEROLE capabilities, so it cannot create extensions by default.Read 4 Oct 2026 · github.com
Migration integrations
Built-in adapters are listed for pgmigrate, golang-migrate, goose, dbmate, Atlas, sql-migrate, Bun, and Tern; custom migrators are also supported.Read 4 Oct 2026 · github.com
Permissions
The configured server user needs capabilities to create databases and roles, and the README recommends using a dedicated testing server rather than production.Read 4 Oct 2026 · github.com
Postgres requirement
Users must provide a running Postgres server; the README describes Docker, native installations, and remote servers as options.Read 4 Oct 2026 · github.com
Speed
The README says creating a test database from a template takes on the order of 10 milliseconds.Read 4 Oct 2026 · github.com
Template databases
It runs migrations once to build a template database and clones that template for individual tests.Read 4 Oct 2026 · github.com

Plans and prices

pgtestdb Free Open source Go library · requires a Postgres server Read 4 Oct 2026 · github.com

Every pgtestdb plan and price →

Where Specifiction places it

Alternatives to pgtestdbAll alternatives →