import { type IMemoryDb } from "https://deno.land/x/pg_mem@3.0.3/mod.ts";
Properties
readonly
adapters: LibAdaptersAdapters to create wrappers of this db compatible with known libraries
readonly
public: ISchemaThe default 'public' schema
Methods
getSchema(db?: string | null): ISchema
Get an existing schema
createSchema(name: string): ISchema
Create a schema in this database
getTable<T = any>(table: string): IMemoryTable<T>
Get a table to inspect it (in the public schema... this is a shortcut for db.public.getTable())
getTable<T = any>(table: string, nullIfNotFound?: boolean): IMemoryTable<T> | null
on(event: "query", handler: (query: string) => any): ISubscription
Subscribe to a global event
on(event: GlobalEvent, handler: () => any): ISubscription
on(event: GlobalEvent, handler: () => any): ISubscription
on(event: TableEvent, handler: (table: string) => any): ISubscription
Subscribe to an event on all tables
backup(): IBackup
Creates a restore point. 👉 This operation is O(1) (instantaneous, even with millions of records).
registerExtension(name: string, install: (schema: ISchema) => void): this
Registers an extension (that can be installed using the 'create extension' statement)
registerLanguage(languageName: string, compiler: LanguageCompiler): this
Registers a new language, usable in 'DO' blocks, or in 'CREATE FUNCTION' blocks