Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/denogres/mod.ts>Model

Deno + PostgreSQL = DenoGres
Go to Latest
class Model
import { Model } from "https://deno.land/x/denogres@v0.7.0-alpha/mod.ts";

Index Signatures

[k: string]: any

Static Properties

private
sql: string
checks: string[]
columns: { [key: string]: { type: string; primaryKey?: boolean; notNull?: boolean; unique?: boolean; checks?: string[]; defaultVal?:
| string
| number
| boolean
| Date
; autoIncrement?: boolean; association?: { rel_type?: string; table: string; mappedCol: string; }; length?: number; enumName?: string; }; }
foreignKey: { columns: string[]; mappedColumns: string[]; rel_type?: string; table: string; }[]
primaryKey: string[]
table: string
unique: Array<string[]>

Static Methods

avg(column: string)
belongsTo(targetModel: Model, options?: belongToOptions)
count(column: string)
edit(...condition: string[])
fullJoin(
column1: string,
column2: string,
table2: string,
)
group(...column: string[])
hasMany(targetModel: Model, options?: hasManyOptions)
hasOne(targetModel: Model, options?: hasOneOptions)
having(...condition: string[])
innerJoin(
column1: string,
column2: string,
table2: string,
)
insert(...value: string[])
leftJoin(
column1: string,
column2: string,
table2: string,
)
limit(limit: number)
max(column: string)
min(column: string)
order(order: string, ...column: string[])
query(): Promise<unknown[]>
queryInstance(print?: string)
rightJoin(
column1: string,
column2: string,
table2: string,
)
select(...column: string[])
sum(column: string)
where(...condition: string[])