Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pg_mem/mod.ts>LibAdapters

An in memory postgres DB instance for your unit tests
Latest
interface LibAdapters
import { type LibAdapters } from "https://deno.land/x/pg_mem@3.0.3/mod.ts";

Methods

createPg(queryLatency?: number): { Pool: any; Client: any; }

Create a PG module that will be equivalent to require('pg')

createPgPromise(queryLatency?: number): any

Create a pg-promise instance bound to this db

createSlonik(opts?: SlonikAdapterOptions): Promise<any>

Create a slonik pool bound to this db

createPgNative(queryLatency?: number): any

Create a pg-native instance bound to this db

deprecated
createTypeormConnection(typeOrmConnection: any, queryLatency?: number): any

Create a Typeorm connection bound to this db

createTypeormDataSource(typeOrmConnection: any, queryLatency?: number): any

Create a Typeorm data source bound to this db

createKnex(queryLatency?: number, knexConfig?: object): any

Create a Knex.js instance bound to this db

createKysely(queryLatency?: number, kyselyConfig?: object): any

Create a Kysely instance bound to this db

createMikroOrm(mikroOrmOptions: any, queryLatency?: number): Promise<any>

Create a mikro-orm instance bound to this db

createPostgresJsTag(queryLatency?: number): any

Creates a Postres.js sql tag bound to this db

bindServer(opts?: BindServerOptions): Promise<BindServerResult>

Binds a server to this instance