diff --git a/lib/client.js b/lib/client.js index 4ec0b0e7..173291f2 100644 --- a/lib/client.js +++ b/lib/client.js @@ -196,7 +196,8 @@ p._pulseQueryQueue = function() { this.activeQuery.submit(this.connection); } else if(this.hasExecuted) { this.activeQuery = null; - this._drainPaused > 0 ? this._drainPaused++ : this.emit('drain') + if(this._drainPaused > 0) { this._drainPaused++; } + else { this.emit('drain'); } } } }; @@ -211,7 +212,7 @@ p._copy = function (text, stream) { } else { config.stream.close(); } - } + }; query = new Query(config); this.queryQueue.push(query); this._pulseQueryQueue(); @@ -220,10 +221,10 @@ p._copy = function (text, stream) { }; p.copyFrom = function (text) { return this._copy(text, new CopyFromStream()); -} +}; p.copyTo = function (text) { return this._copy(text, new CopyToStream()); -} +}; p.query = function(config, values, callback) { //can take in strings, config object or query object var query = (config instanceof Query) ? config : new Query(config, values, callback);