UNPKG

@adinet/indigodb

Version:

ORM for PostgreSQL and MongoDB with real-time support

20 lines (19 loc) 614 B
import { ModelSchema } from "../types"; import ORM from "../orm"; declare class PostgresModel<T> { private name; private schema; private orm; private client; constructor(name: string, schema: ModelSchema, orm: ORM); private init; private createTable; private setupTriggers; create(data: Partial<T>): Promise<T>; findAll(criteria?: Partial<T>): Promise<T[]>; findById(id: any): Promise<T | null>; update(id: any, data: Partial<T>): Promise<T | null>; delete(id: any): Promise<T | null>; private mapDataType; } export default PostgresModel;