Module

x/pg_mem/interfaces-private.ts>_ITable

An in memory postgres DB instance for your unit tests
Latest
interface _ITable
implements IMemoryTable<any>, _RelationBase
import { type _ITable } from "https://dotland.deno.dev/x/pg_mem@3.0.3/interfaces-private.ts";

Properties

readonly
type: "table"
readonly
hidden: boolean
readonly
db: _IDb
readonly
selection: _ISelection
readonly
ownerSchema: _ISchema

Methods

doInsert(
toInsert: Row,
opts?: ChangeOpts,
): Row | nil | void
setHidden(): this
setReadonly(): this
delete(t: _Transaction, toDelete: Row): void
update(t: _Transaction, toUpdate: Row): Row | never
createIndex(t: _Transaction, expressions: CreateIndexDef): _IConstraint | nil
createIndex(
expressions: Name[],
type: "primary" | "unique",
indexName?: string | nil,
): _IConstraint
setReadonly(): this

Create a column

getColumnRef(column: string): _Column

Get a column to modify it

getColumnRef(column: string, nullIfNotFound?: boolean): _Column | nil
rename(to: string): this
getConstraint(constraint: string): _IConstraint | nil
addConstraint(constraint: TableConstraint, t: _Transaction): _IConstraint | nil
getIndex(...forValues: IValue[]): _IIndex | nil
dropIndex(t: _Transaction, name: string): void
drop(t: _Transaction, cascade: boolean): void
onBeforeChange(columns: (string | _Column)[], check: ChangeHandler): ISubscription

Will be executed when one of the given columns is affected (update/delete)

onCheckChange(columns: "all" | (string | _Column)[], check: ChangeHandler): ISubscription

Will be executed once all 'onBeforeChange' handlers have ran (coherency checks)

onTruncate(sub: TruncateHandler): ISubscription
truncate(t: _Transaction, truncateOpts?: TruncateOpts): void