diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 6a2bd068d5..2b442b1227 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -42,6 +42,7 @@ export interface PoolConfig extends ClientConfig { reapIntervalMillis?: number; returnToHead?: boolean; application_name?: string; + Promise?: PromiseConstructorLike; } export interface QueryConfig { @@ -71,7 +72,7 @@ export declare class Pool extends events.EventEmitter { connect(callback: (err: Error, client: Client, done: () => void) => void): void; end(): Promise; - + query(queryStream: QueryConfig & stream.Readable): stream.Readable; query(queryTextOrConfig: string | QueryConfig): Promise; query(queryText: string, values: any[]): Promise; diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index bdf49ab240..2fe301935a 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -1,5 +1,6 @@ import * as pg from "pg"; +import * as bluebird from "bluebird"; var conString = "postgres://username:password@localhost/database"; @@ -54,6 +55,7 @@ var config = { port: 5432, //env var: PGPORT max: 10, // max number of clients in the pool idleTimeoutMillis: 30000, // how long a client is allowed to remain idle before being closed + Promise: bluebird }; var pool = new pg.Pool(config);