@@ -9,6 +9,7 @@ var defaults = require(__dirname + '/defaults');
99var Connection = require ( __dirname + '/connection' ) ;
1010var CopyFromStream = require ( __dirname + '/copystream' ) . CopyFromStream ;
1111var CopyToStream = require ( __dirname + '/copystream' ) . CopyToStream ;
12+
1213var Client = function ( config ) {
1314 EventEmitter . call ( this ) ;
1415
@@ -22,7 +23,7 @@ var Client = function(config) {
2223 config = config || { } ;
2324
2425 this . connection = config . connection || new Connection ( {
25- stream : config . stream ,
26+ stream : config . stream ,
2627 ssl : config . ssl
2728 } ) ;
2829 this . queryQueue = [ ] ;
@@ -112,10 +113,12 @@ p.connect = function(callback) {
112113 } ) ;
113114 con . on ( 'copyOutResponse' , function ( msg ) {
114115 if ( self . activeQuery . stream === undefined ) {
115- self . activeQuery . _canceledDueToError = new Error ( 'No destination stream defined' ) ;
116- //canceling query requires creation of new connection
116+ self . activeQuery . _canceledDueToError =
117+ new Error ( 'No destination stream defined' ) ;
118+ //canceling query requires creation of new connection
117119 //look for postgres frontend/backend protocol
118- ( new self . constructor ( { port : self . port , host : self . host } ) ) . cancel ( self , self . activeQuery ) ;
120+ ( new self . constructor ( { port : self . port , host : self . host } ) )
121+ . cancel ( self , self . activeQuery ) ;
119122 }
120123 } ) ;
121124 con . on ( 'copyData' , function ( msg ) {
@@ -202,7 +205,7 @@ p._pulseQueryQueue = function() {
202205 }
203206} ;
204207p . _copy = function ( text , stream ) {
205- var config = { } ,
208+ var config = { } ,
206209 query ;
207210 config . text = text ;
208211 config . stream = stream ;
@@ -227,7 +230,8 @@ p.copyTo = function (text) {
227230} ;
228231p . query = function ( config , values , callback ) {
229232 //can take in strings, config object or query object
230- var query = ( config instanceof Query ) ? config : new Query ( config , values , callback ) ;
233+ var query = ( config instanceof Query ) ? config :
234+ new Query ( config , values , callback ) ;
231235 if ( this . binary && ! query . binary ) {
232236 query . binary = true ;
233237 }
@@ -237,7 +241,8 @@ p.query = function(config, values, callback) {
237241 return query ;
238242} ;
239243
240- //prevents client from otherwise emitting 'drain' event until 'resumeDrain' is called
244+ //prevents client from otherwise emitting 'drain' event until 'resumeDrain' is
245+ //called
241246p . pauseDrain = function ( ) {
242247 this . _drainPaused = 1 ;
243248} ;
0 commit comments