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

x/pg_mem/schema/readonly-table.ts>ReadOnlyTable

An in memory postgres DB instance for your unit tests
Go to Latest
class ReadOnlyTable
implements _ITable, _ISelection
extends DataSourceBase<T>
Abstract
import { ReadOnlyTable } from "https://deno.land/x/pg_mem@2.6.7/schema/readonly-table.ts";

Constructors

new
ReadOnlyTable(schema: _ISchema)

Type Parameters

optional
T = any

Properties

private
optional
_columns: IValue[]
private
columnsById: Map<string, IValue>
abstract
readonly
_schema: Schema
readonly
columns: ReadonlyArray<IValue<any>>
readonly
hidden: boolean
readonly
isExecutionWithNoResult: boolean
readonly
name: string
reg: Reg
readonly
selection: _ISelection
readonly
type

Methods

private
build()
delete(t: _Transaction, toDelete: T): void
doInsert(toInsert: any): void
drop(t: _Transaction): void
dropIndex(t: _Transaction, name: string): void
abstract
entropy(t: _Transaction): number
abstract
enumerate(t: _Transaction): Iterable<T>
find(template?: T, columns?: (keyof T)[]): Iterable<T>
getColumn(column: string | ExprRef): IValue
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
getColumnRef(column: string, nullIfNotFound?: boolean): _Column
getConstraint(constraint: string): _IConstraint | nil
getIndex(...forValue: IValue[]): _IIndex<any> | nil
abstract
hasItem(value: T, t: _Transaction): boolean
insert(item: any)
isOriginOf(v: IValue): boolean
itemsByTable(table: string | _ITable, t: _Transaction): IterableIterator<any>
make(
table: _ITable,
i: number,
t: IValue<any>,
): any
on(): any
onBeforeChange(columns: string[], check: ChangeHandler<T>)
onCheckChange(columns: string[], check: ChangeHandler<T>)
rename(to: string): this
setHidden(): this
setReadonly(): this
update(t: _Transaction, toUpdate: any)