diff --git a/lib/pool.js b/lib/pool.js index 358cb2c1..d05a16ff 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -6,6 +6,7 @@ var genericPool = require('generic-pool'); module.exports = function(Client) { var pools = { + Client: Client, //dictionary of all key:pool pairs all: {}, //reference to the client constructor - can override in tests or for require('pg').native @@ -23,7 +24,7 @@ module.exports = function(Client) { reapIntervalMillis: clientConfig.reapIntervalMillis || defaults.reapIntervalMillis, log: clientConfig.poolLog || defaults.poolLog, create: function(cb) { - var client = new Client(clientConfig); + var client = new pools.Client(clientConfig); // Ignore errors on pooled clients until they are connected. client.on('error', Function.prototype); client.connect(function(err) {