Module

x/justaos_orm/src/table/Table.ts>default

JUSTAOS's ORM (Object–relational mapping) tool is built for Deno and provides transparent persistence for JavaScript objects to Postgres database.
Go to Latest
class default
import { default } from "https://dotland.deno.dev/x/justaos_orm@v9.1.2/src/table/Table.ts";

Constructors

new
default(
queryBuilder: Query,
tableDefinition: TableDefinition,
registriesHandler: RegistriesHandler,
logger: Logger,
pool: pg.Pool,
)

Methods

count(): Promise<number>

Disable all triggers on the table

disableIntercept(interceptName: string): void

Enable all triggers on the table

execute(): Promise<() => AsyncGenerator<Record, void, unknown>>

Execute the query and return cursor

getRecord(idOrColumnNameOrFilter: UUID4 | string | { [key: string]: any; }, value?: any): Promise<Record | undefined>

Get a record by its ID or a column name and value

getSelectedColumns(): string[]
intercept(): Promise<Record[]>

Intercepts table operation

limit(limit: number): Table
offset(offset: number): Table
orderBy(columnNameOrOrderList?: string | OrderByType[], direction?: OrderByDirectionType): Table
select(): Table
toArray(): Promise<Record[]>

Execute the query and return result as array

where(
column: string | number | boolean,
operator: any,
value?: any,
): Table

Static Methods

getFullFormTableName(name: string): string
getShortFormTableName(name: string): string