Pgsql Test
Instant, Isolated PostgreSQL Testing
Get instant, isolated PostgreSQL databases for each test with automatic transaction rollbacks, context switching, and clean seeding. Write real SQL. Get real coverage. Stay fast.
Each one seeded, isolated, and UUID-named
Every test runs in its own transaction or savepoint
Test with role-based auth via setContext()
Optimize your PostgreSQL testing workflow
Get fresh PostgreSQL databases for each test, seeded and isolated with UUID-based naming for zero conflicts.
Every test runs in its own transaction or savepoint, ensuring complete isolation and automatic cleanup.
Test with role-based authentication via setContext() to simulate real-world RLS scenarios.
Run .sql files, programmatic seeds, CSV/JSON fixtures, or even load Sqitch/LaunchQL migrations.
Works seamlessly with Jest, Mocha, and any async test runner for maximum flexibility.
No residue, no reboots, just clean exits with automatic cleanup of test databases.
Get started with pgsql-test in seconds. Each test gets its own isolated database with automatic transaction rollbacks, ensuring clean state between tests.
Test Row-Level Security policies by simulating different user roles and JWT claims. Perfect for testing authentication and authorization logic.
Compose multiple seeding strategies including SQL files, programmatic functions, CSV/JSON data, and LaunchQL migrations for comprehensive test setup.