Tiny utilities (v0.6.2) that smooth integration of Drizzle ORM with pg-mem for fast in-memory testing. Applies permanent shims for rowMode and getTypeParser, plus optional integrations like arrayRowToObject, countToValue, and randomFunctionPolyfill. Declared stable with deterministic alphabetical integration ordering and idempotent application. Unlike manual shimming, drizzle-pgmem is tested against the specific versions of Drizzle and pg-mem it targets, and provides a simple API to enable/disable integrations. Requires Node >=18 and peer dependencies drizzle-orm and pg-mem.
npm install drizzle-pgmemNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an in-memory PostgreSQL database with pg-mem and applies drizzle-pgmem integrations to avoid common Drizzle ORM compatibility issues.
Ensure applyIntegrationsToPool(pool) runs before drizzle(pool).
Use only one of the two options to avoid confusion.
Explicitly pass activeIntegrations: ['arrayRowToObject', 'countToValue', 'randomFunctionPolyfill'] if you need the old behavior.
Replace any references to IntegrationList with IntegrationName.
Ensure at least one query (e.g., SELECT 1) is run before invoking Drizzle migrations that use random().
Add "type": "module" to your package.json, or use .mjs extension for your files. If using TypeScript, set "moduleResolution": "Node16" or "Bundler" in tsconfig.json.
Call applyIntegrationsToPool(pool) immediately after creating the pool and before passing it to drizzle().
Use `import type { IntegrationName } from 'drizzle-pgmem'`.