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
Latest
class ReadOnlyTable
implements _ITable, _ISelection
Abstract
import { ReadOnlyTable } from "https://deno.land/x/pg_mem@3.0.3/schema/readonly-table.ts";

Constructors

new
ReadOnlyTable(schema: _ISchema)

Properties

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

Methods

private
build()
protected
buildColumnEvaluator(_col: SchemaField, idx: number): IValue
delete(t: _Transaction, toDelete: Row): 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<Row>
find(template?: Row, columns?: (keyof Row)[]): Row[]
getColumn(column: string | ExprRef): IValue
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
getColumnRef(column: string, nullIfNotFound?: boolean): _Column
getColumns(): Iterable<ColumnDef>
getConstraint(constraint: string): _IConstraint | nil
getIndex(...forValue: IValue[]): _IIndex | nil
abstract
hasItem(value: Row, 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
on(): any
onBeforeChange(columns: string[], check: ChangeHandler)
onCheckChange(columns: string[], check: ChangeHandler)
rename(to: string): this
setHidden(): this
setReadonly(): this
update(t: _Transaction, toUpdate: any): never