UNPKG

601 BTypeScriptView Raw
1import * as pgPool from 'pg-pool';
2import Pool = pgPool.Pool;
3import { QueryResult } from "pg";
4export declare const DB_QUERY = "DB_QUERY";
5export declare const NO_ROW_ERROR = "DB_NO_SUCH_";
6export declare class PgService {
7 protected pool: Pool;
8 constructor(pgPool: Pool);
9 run(query: string, params?: Array<any>): Promise<QueryResult>;
10 getRows(query: string, params?: Array<any>): Promise<Array<any>>;
11 getRow(query: string, params?: Array<any>): Promise<any>;
12 mustGetRow(errorCode: string, query: string, params?: Array<any>): Promise<any>;
13 private _run(query, params?);
14}