Module

x/pg_mem/mod.ts>IMemoryTable

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

Properties

readonly
name: string
readonly
primaryIndex: IndexDef | nil

Methods

getColumns(): Iterable<ColumnDef>

List columns in this table

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 | null

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<keys extends (keyof T)[]>(template?: Partial<T> | nil, columns?: keys): Pick<T, ArrayToUnionOr<keys, keyof T>>[]

Find all items matching a specific template