Skip to content

Commit cb4d137

Browse files
committed
Port backwards-compabible properties
1 parent 5b1b13d commit cb4d137

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ PG.prototype.connect = function(config, callback) {
4646
callback = config;
4747
config = null;
4848
}
49-
var poolName = config || '__DEFAULT';
49+
var poolName = JSON.stringify(config || {});
5050
if (typeof config == 'string') {
5151
config = new ConnectionParameters(config);
5252
}
5353

54+
config = config || {};
55+
56+
//for backwards compatibility
57+
config.max = config.max || config.poolSize || defaults.poolSize;
58+
config.idleTimeoutMillis = config.idleTimeoutMillis || config.poolIdleTimeout || defaults.poolIdleTimeout;
59+
config.log = config.log || config.poolLog || defaults.poolLog;
60+
5461
this.pools[poolName] = this.pools[poolName] || new Pool(config, this.Client);
5562
var pool = this.pools[poolName];
5663
pool.connect(callback);

test/integration/domain-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var async = require('async')
44
var testWithoutDomain = function(cb) {
55
test('no domain', function() {
66
assert(!process.domain)
7-
console.log(helper.pg.Client)
87
helper.pg.connect(helper.config, assert.success(function(client, done) {
98
assert(!process.domain)
109
done()

0 commit comments

Comments
 (0)