# hexclave/pgmock

In-memory Postgres for unit/E2E tests

Repository: https://github.com/hexclave/pgmock
Canonical: https://ross.abutalabs.com/products/pgmock
Homepage: https://stackframe-projects.github.io/pgmock/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2025-11-26T01:59:31+00:00

## Health v2 (maintenance only)
Score: 49/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 54, release rhythm 35, longevity 63
- inputs: {"age_days": 887, "days_push": 281, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1231, forks 24 (observed 2026-08-28T04:04:04.216477+00:00)

## What it is
pgmock is an in-memory PostgreSQL mock server for unit and E2E tests that runs entirely in WebAssembly on Node.js and in the browser, with no external dependencies. It emulates a full Postgres server via an x86 emulator to achieve feature parity with production PostgreSQL environments.

## Use cases
- run an in-memory postgres database for unit tests
- mock postgres in e2e tests without docker
- use a real postgres server in the browser for testing
- test node-postgres clients against a disposable database
- avoid discrepancies between test and production postgres environments

## When to choose
- you need full Postgres feature parity (connections, extensions) in tests
- you want a zero-dependency, in-process Postgres for Node.js or browser tests
- performance of the database is not critical but correctness is

## When to avoid
- you only need a lightweight browser-side SQL database (consider pglite)
- test suite performance is critical, since x86 emulation is slow
- you need a production-grade persistent Postgres instance

## Facets
- artifact type: library
- maturity: active
- function: testing, mocking, database, e2e-testing
- domain: testing, databases, developer-tools
- platform: browser, wasm
- tags: in-memory-postgres, wasm, unit-testing, postgres-mock, test-doubles, nodejs, javascript

## Member repositories
- hexclave/pgmock (main) score 49

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.216477+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:22:30.190308+00:00, confidence not recorded.
  - readme: https://github.com/hexclave/pgmock (fetched 2026-08-28T04:04:04.216477+00:00, sha 934a7aa24037)
- Data as of 2026-08-30T08:39:29.467469+00:00.
