Module

x/pg_mem/schema/schema.ts>DbSchema

An in memory postgres DB instance for your unit tests
Go to Latest
class DbSchema
implements _ISchema, ISchema
import { DbSchema } from "https://dotland.deno.dev/x/pg_mem@2.6.13/schema/schema.ts";

Constructors

new
DbSchema(name: string, db: _IDb)

Properties

private
_tables: Set<_ITable>
private
installedExtensions: Set<string>
private
interceptors: Set<{ readonly intercept: QueryInterceptor; }>
private
optional
lastSelect: _ISelection
private
readonly: any
private
relsByCls: Map<number, _IRelation>
private
relsByNameCas: Map<string, _IRelation>
private
relsByTyp: Map<number, _IRelation>
private
simpleTypes: { [key: string]: _IType; }
private
sizeableTypes: { [key: string]: { ctor: (...sz: number[]) => _IType; regs: Map<number | string | undefined, _IType>; }; }
readonly
dualTable: _ITable

Methods

private
_registerOperator(fn: OperatorDefinition, replace: boolean): this
private
parse(query: QueryOrAst): Statement[]
_reg_rename(
oldName: string,
newName: string,
): void
_registerType(type: _IType): this
_registerTypeSizeable(name: string, ctor: (sz?: number) => _IType): this
_unregisterType(type: _IType): this
declareTable(table: Schema, noSchemaChange?: boolean): MemoryTable
getFunction(name: string, args: _IType[]): _FunctionDefinition | nil
getObjectByRegClassId(reg: number, opts?: QueryObjOpts): _IRelation | null
getOwnObject(name: string): _IRelation | null
getTable(name: string): _ITable
getTable(name: string, nullIfNotFound?: boolean): _ITable | null
listTables(): Iterable<_ITable>
many(query: QueryOrAst): any[]
migrate(config?: IMigrate.MigrationParams)
none(query: QueryOrAst): void
one(query: QueryOrAst): any
parseType(native: string): _IType
queries(query: QueryOrAst): Iterable<QueryResult>
registerEnum(name: string, values: string[])
registerFunction(fn: FunctionDefinition, replace?: boolean): this
registerOperator(op: OperatorDefinition, replace?: boolean): this
resolveFunction(
name: string | QName,
args: IValue[],
forceOwn?: boolean,
): _FunctionDefinition | nil
resolveOperator(
left: IValue,
right: IValue,
forceOwn?: boolean,
): _OperatorDefinition | nil