From 7309ef449891f2b3e4b5f4ce6d4b191020a45c39 Mon Sep 17 00:00:00 2001 From: Aaron Petcoff Date: Thu, 25 May 2017 17:40:39 -0400 Subject: [PATCH 1/2] adds promise to PoolConfig in pg --- types/pg/index.d.ts | 3 ++- types/pg/pg-tests.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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..989a35ea87 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 "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); From ee909ca4979c3f9b2add7d93ce502158aa3755c0 Mon Sep 17 00:00:00 2001 From: Aaron Petcoff Date: Thu, 25 May 2017 17:49:47 -0400 Subject: [PATCH 2/2] duh forgot to add the word 'from' --- types/pg/pg-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index 989a35ea87..2fe301935a 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -1,6 +1,6 @@ import * as pg from "pg"; -import * as bluebird "bluebird"; +import * as bluebird from "bluebird"; var conString = "postgres://username:password@localhost/database";