Skip to main content
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.3/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()
addColumn(column: SchemaField | CreateColumnDef): _Column
addConstraint(constraint: TableConstraint, t: _Transaction): _IConstraint
createIndex(): _IConstraint
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>
explain(e: _Explainer): _SelectExplanation
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>
listIndices(): IndexDef[]
make(
table: _ITable,
i: number,
t: IValue<any>,
): any
on(): any
onBeforeChange(columns: string[], check: ChangeHandler<T>)
onCheckChange(columns: string[], check: ChangeHandler<T>)
onDrop(sub: DropHandler): ISubscription
onIndex(sub: IndexHandler): ISubscription
onTruncate(sub: TruncateHandler): ISubscription
rename(to: string): this
setHidden(): this
setReadonly(): this
stats(t: _Transaction): Stats | null
truncate(t: _Transaction): void
update(t: _Transaction, toUpdate: any)