{"library":"pgmock2","type":"library","category":null,"description":"pgmock2 is a JavaScript and TypeScript library designed for mocking PostgreSQL database connections, primarily for testing applications that rely on the popular `pg` npm package. It provides a mechanism to simulate `pg.Client` and `pg.Pool` instances by allowing developers to pre-define SQL queries and their expected responses, including `rowCount` and `rows` data. The library supports both basic type validation for query parameters and more complex validation logic using custom functions. Currently at version 2.1.7, it appears to be actively maintained, though a specific release cadence isn't explicitly stated. Its core differentiation lies in its direct integration with the `pg` interface, ensuring that mocked connections behave nearly identically to real `pg` connections, thereby minimizing changes needed in application code during testing.","language":"javascript","status":"active","version":"2.1.7","tags":["javascript","pg","postgres","postgresql","mock","test","testing","typescript"],"install":[{"cmd":"npm install pgmock2","imports":["import PgMock2 from 'pgmock2';","import PgMock2, { PgMock2Client } from 'pgmock2';\n// Or for the instance:\nconst client = new PgMock2();","import type { QueryConfig } from 'pgmock2';"]},{"cmd":"yarn add pgmock2","imports":[]},{"cmd":"pnpm add pgmock2","imports":[]}],"homepage":"https://jfavrod.github.io/pgmock2/","github":"https://github.com/jfavrod/pgmock2","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/pgmock2","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/pgmock2/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Tue Jul 21","install_tag":null}}