From 086757120708441818e7a65c181cd1adf078d914 Mon Sep 17 00:00:00 2001 From: Arnaud Benhamdine Date: Wed, 30 Aug 2017 22:19:20 +0200 Subject: [PATCH 1/4] Remove properties no more used in node-pg-pool --- lib/defaults.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/defaults.js b/lib/defaults.js index 62f2ad158..f0a6208f9 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -35,23 +35,15 @@ module.exports = { // binary result mode binary: false, - // Connection pool options - see https://github.com/coopernurse/node-pool + // Connection pool options - see https://github.com/brianc/node-pg-pool + // number of connections to use in connection pool // 0 will disable connection pooling poolSize: 10, // max milliseconds a client can go unused before it is removed // from the pool and destroyed - poolIdleTimeout: 30000, - - // frequency to check for idle clients within the client pool - reapIntervalMillis: 1000, - - // if true the most recently released resources will be the first to be allocated - returnToHead: false, - - // pool log function / boolean - poolLog: false, + idleTimeoutMillis: 30000, client_encoding: '', From 442c48bdb1d08d49438bcb22694fe37b58e9a1e6 Mon Sep 17 00:00:00 2001 From: Arnaud Benhamdine Date: Wed, 30 Aug 2017 22:21:06 +0200 Subject: [PATCH 2/4] Prefer max over poolSize : max is the only property documented in node-pg-pool --- lib/defaults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/defaults.js b/lib/defaults.js index f0a6208f9..e99abef42 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -39,7 +39,7 @@ module.exports = { // number of connections to use in connection pool // 0 will disable connection pooling - poolSize: 10, + max: 10, // max milliseconds a client can go unused before it is removed // from the pool and destroyed From 3722cff0cb07ccd36a7beb50d917baf5461238b0 Mon Sep 17 00:00:00 2001 From: Arnaud Benhamdine Date: Wed, 30 Aug 2017 22:46:52 +0200 Subject: [PATCH 3/4] Replace poolSize by max in configuration test --- test/integration/client/configuration-tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/client/configuration-tests.js b/test/integration/client/configuration-tests.js index 9d3b7f5ab..36391ab0f 100644 --- a/test/integration/client/configuration-tests.js +++ b/test/integration/client/configuration-tests.js @@ -18,7 +18,7 @@ suite.test('default values are used in new clients', function () { password: null, port: 5432, rows: 0, - poolSize: 10 + max: 10, }) var client = new pg.Client() From d3d18a38e411c1fd88a2a4d048f77a9b36c6f881 Mon Sep 17 00:00:00 2001 From: Arnaud Benhamdine Date: Wed, 30 Aug 2017 22:47:17 +0200 Subject: [PATCH 4/4] Check more default properties in configuration teset --- test/integration/client/configuration-tests.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/client/configuration-tests.js b/test/integration/client/configuration-tests.js index 36391ab0f..87bb52d47 100644 --- a/test/integration/client/configuration-tests.js +++ b/test/integration/client/configuration-tests.js @@ -19,6 +19,13 @@ suite.test('default values are used in new clients', function () { port: 5432, rows: 0, max: 10, + binary: false, + idleTimeoutMillis: 30000, + client_encoding: '', + ssl: false, + application_name: undefined, + fallback_application_name: undefined, + parseInputDatesAsUTC: false }) var client = new pg.Client()