pgmock Web Demo

pgmock repositoryDiscord

This is a web demo for pgmock, a feature-complete PostgreSQL mock for WebAssembly.

It is designed for use in unit and E2E testing, but can run standalone in-memory in a browser. For more information, check the pgmock repository.

If your primary use case is to run a database in the browser (and only the browser), you might want to consider pglite instead. It is more performant and lightweight (with a limited feature set). pgmock is designed for feature parity with production PostgreSQL environments, as you would want in a testing environment.

node-postgres Queries

Loading...
Example source code:
const postgresMock = new PostgresMock();
const client = new pg.Client(postgresMock.getNodePostgresConfig());
await client.connect();
await client.query(...);

Serial console

Downloading Postgres image...