Skip to content

Commit a84cf05

Browse files
dkarpmanjohnfn
authored andcommitted
Update index.js
1 parent 534fddc commit a84cf05

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/index.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,22 @@ PG.prototype.connect = function(config, callback) {
4545
callback = config;
4646
config = null;
4747
}
48-
var pool = this.pools.getOrCreate(config);
48+
var client = new this.Client(config);
49+
client.connect(function(err) {
50+
if(err) {
51+
return callback && callback(err);
52+
}
53+
return callback && callback(null, client, function() {
54+
client.end();
55+
});
56+
// client.query()
57+
});
58+
/* var pool = this.pools.getOrCreate(config);
4959
pool.connect(callback);
5060
if(!pool.listeners('error').length) {
5161
//propagate errors up to pg object
5262
pool.on('error', this.emit.bind(this, 'error'));
53-
}
63+
} */
5464
};
5565

5666
// cancel the query runned by the given client

0 commit comments

Comments
 (0)