Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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.
Latest
class default
import { default } from "https://deno.land/x/justaos_orm@v10.0.0/src/table/Table.ts";

Constructors

new
default(
tableDefinition: TTableDefinition,
registriesHandler: RegistriesHandler,
logger: Logger,
)

Methods

andWhere(
columnOrCompoundFunction:
| string
| number
| boolean
| ((where: WhereClause) => void)
,
operatorOrValue?: TWhereClauseOperator | any,
value?: any,
): Table

This method is used to set the AND where clause. (same as where)

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

intercept(operation: TRecordInterceptorType, records: Record[]): Promise<Record[]>

Intercepts table operation

limit(limit: number): Table
offset(offset: number): Table
orderBy(columnNameOrOrderList?: string | TOrderBy[], direction?: TOrderByDirection): Table
orWhere(
columnOrCompoundFunction:
| string
| number
| boolean
| ((where: WhereClause) => void)
,
operatorOrValue?: TWhereClauseOperator | any,
value?: any,
): Table

This method is used to set the or where clause for the table query.

toArray(): Promise<Record[]>

Execute the query and return result as array

where(
columnOrCompoundFunction:
| string
| number
| boolean
| ((where: WhereClause) => void)
,
operatorOrValue?: TWhereClauseOperator | any,
value?: any,
): Table

This method is used to set the where clause for the table query.

Static Methods

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