{"library":"pg-transactional-tests","type":"library","category":null,"description":"pg-transactional-tests is a utility library designed to simplify database testing by wrapping each test in a PostgreSQL transaction. It currently stands at version 1.2.0, with a stable release cadence implied by its versioning and active development. The library patches the `pg` package to automatically initiate a transaction before a test, and then roll it back afterward, ensuring a clean database state for every test run without the overhead of clearing tables. A key differentiator is its compatibility with many popular ORMs like Sequelize, TypeORM, MikroORM, Objection, and Knex, which all build upon the `pg` driver. It also intelligently handles nested transactions using savepoints and supports parallel testing across multiple databases by tracking transaction state per connection. A significant limitation is its incompatibility with Prisma, due to Prisma's distinct database interaction model. This approach vastly accelerates test suites and reduces boilerplate for database setup and teardown.","language":"javascript","status":"active","version":"1.2.0","tags":["javascript","pg","postgres","transactional tests","test","typescript"],"install":[{"cmd":"npm install pg-transactional-tests","imports":["import { testTransaction } from 'pg-transactional-tests';","beforeEach(testTransaction.start);","afterEach(testTransaction.rollback);","afterAll(testTransaction.close);"]},{"cmd":"yarn add pg-transactional-tests","imports":[]},{"cmd":"pnpm add pg-transactional-tests","imports":[]}],"homepage":null,"github":"https://github.com/romeerez/pg-transactional-tests","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/pg-transactional-tests","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/pg-transactional-tests/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}