From c03e601a5079f67aae15d2780e8c01d2136da18e Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Fri, 11 Aug 2017 16:23:04 +0800 Subject: [PATCH] Update pg-query-stream test to use pg@7.1 API. --- types/pg-query-stream/pg-query-stream-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/pg-query-stream/pg-query-stream-tests.ts b/types/pg-query-stream/pg-query-stream-tests.ts index 6c4c034102..1df78ea648 100644 --- a/types/pg-query-stream/pg-query-stream-tests.ts +++ b/types/pg-query-stream/pg-query-stream-tests.ts @@ -8,7 +8,8 @@ const options: QueryStream.Options = { const query = new QueryStream('SELECT * FROM generate_series(0, $1) num', [1000000], options); -pg.connect('', (err, client, done) => { +const pool = new pg.Pool(); +pool.connect((err, client, done) => { const stream = client.query(query); stream.on('end', () => { client.end(); @@ -17,3 +18,4 @@ pg.connect('', (err, client, done) => { console.log(data); }); }); +pool.end();