Module

x/pg_mem/mod.ts>IMemoryTable

An in memory postgres DB instance for your unit tests
Go to Latest
interface IMemoryTable
import { type IMemoryTable } from "https://dotland.deno.dev/x/pg_mem@2.6.13/mod.ts";

Type Parameters

optional
T = any

Methods

on(event: TableEvent, handler: () => any): ISubscription

Subscribe to an event on this table

listIndices(): IndexDef[]

List existing indices defined on this table

insert(item: Partial<T>): T

Inserts a raw item into this table. ⚠ Neither the record you provided, nor the returned value are the actual item stored. You wont be able to mutate internal state.

find(template?: Partial<T> | nil, columns?: (keyof T)[]): Iterable<T>

Find all items matching a specific template