pgsql-test: Isolated PostgreSQL Testing Environments
JSON →pgsql-test is a Node.js and TypeScript library, currently at version 4.9.1, that provides instant, isolated, and role-aware PostgreSQL databases for integration testing. It differentiates itself by ensuring each test runs within its own transaction or savepoint, which offers complete isolation, automatic rollbacks, and clean state management without polluting external database environments. Key features include support for testing Row-Level Security (RLS) via `setContext()`, flexible data seeding options (including SQL files, programmatic seeds, and integration with `pgpm` modules), and automatic teardown to prevent resource leaks. The library is actively maintained within the `constructive-io` ecosystem and is designed to be compatible with popular asynchronous test runners like Jest and Mocha, offering a reliable solution for fast and realistic database integration tests.
Traffic · last 30 days ↓20% vs prev 7d
top countries 🇺🇸 United States · 🇫🇮 Finland · 🇫🇷 France · 🇨🇦 Canada · 🇸🇬 Singapore