Skip to main content
Go to Latest
class Repository
extends EventTarget
import { Repository } from "https://deno.land/x/dbx@0.4.1/mod.ts";

Constructors

new
Repository(
type: Class<T>,
schema?: Schema,
name?: string,
capacity?,
)

Properties

optional
baseWhere: Condition<T>
readonly
capacity: number
optional
schema: Schema
table: string
type: Class<T>

Methods

all(debug?): Promise<T[]>
delete<T>(where: Where<T>, debug?): Promise<number>
deleteById(id: number | string, debug?): Promise<boolean>
find(filter?: Filter<T>, debug?): Promise<T[]>
findById(id: number | string, debug?): Promise<T | undefined>
findOne(filter?: Filter<T>, debug?): Promise<T | undefined>
fromRecord(record: Record<string, unknown>, object?: [key in string]?: unknown): T
insert(object: T, debug?): Promise<T>
setBaseWhere(bc: Condition<T>): this
toRecord(object: Partial<T>, record?: Record<string, unknown>): Record<string, unknown>
update(object: Partial<T>, debug?): Promise<T | undefined>

Static Methods

_order<T>(order?: Order<T>): string
_where<T>(
where?: Where<T>,
tree?: Primitive[],
fullTextColumns?: string[],
): string