We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 534fddc commit a84cf05Copy full SHA for a84cf05
lib/index.js
@@ -45,12 +45,22 @@ PG.prototype.connect = function(config, callback) {
45
callback = config;
46
config = null;
47
}
48
- var pool = this.pools.getOrCreate(config);
+ 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);
59
pool.connect(callback);
60
if(!pool.listeners('error').length) {
61
//propagate errors up to pg object
62
pool.on('error', this.emit.bind(this, 'error'));
- }
63
+ } */
64
};
65
66
// cancel the query runned by the given client
0 commit comments