@@ -36,9 +36,7 @@ var Client = function(config) {
36
36
37
37
util . inherits ( Client , EventEmitter ) ;
38
38
39
- var p = Client . prototype ;
40
-
41
- p . connect = function ( callback ) {
39
+ Client . prototype . connect = function ( callback ) {
42
40
var self = this ;
43
41
var con = this . connection ;
44
42
if ( this . host && this . host . indexOf ( '/' ) === 0 ) {
@@ -170,7 +168,7 @@ p.connect = function(callback) {
170
168
171
169
} ;
172
170
173
- p . cancel = function ( client , query ) {
171
+ Client . prototype . cancel = function ( client , query ) {
174
172
if ( client . activeQuery == query ) {
175
173
var con = this . connection ;
176
174
@@ -190,7 +188,7 @@ p.cancel = function(client, query) {
190
188
}
191
189
} ;
192
190
193
- p . _pulseQueryQueue = function ( ) {
191
+ Client . prototype . _pulseQueryQueue = function ( ) {
194
192
if ( this . readyForQuery === true ) {
195
193
this . activeQuery = this . queryQueue . shift ( ) ;
196
194
if ( this . activeQuery ) {
@@ -204,7 +202,8 @@ p._pulseQueryQueue = function() {
204
202
}
205
203
}
206
204
} ;
207
- p . _copy = function ( text , stream ) {
205
+
206
+ Client . prototype . _copy = function ( text , stream ) {
208
207
var config = { } ,
209
208
query ;
210
209
config . text = text ;
@@ -222,13 +221,16 @@ p._copy = function (text, stream) {
222
221
return config . stream ;
223
222
224
223
} ;
225
- p . copyFrom = function ( text ) {
224
+
225
+ Client . prototype . copyFrom = function ( text ) {
226
226
return this . _copy ( text , new CopyFromStream ( ) ) ;
227
227
} ;
228
- p . copyTo = function ( text ) {
228
+
229
+ Client . prototype . copyTo = function ( text ) {
229
230
return this . _copy ( text , new CopyToStream ( ) ) ;
230
231
} ;
231
- p . query = function ( config , values , callback ) {
232
+
233
+ Client . prototype . query = function ( config , values , callback ) {
232
234
//can take in strings, config object or query object
233
235
var query = ( config instanceof Query ) ? config :
234
236
new Query ( config , values , callback ) ;
@@ -243,19 +245,19 @@ p.query = function(config, values, callback) {
243
245
244
246
//prevents client from otherwise emitting 'drain' event until 'resumeDrain' is
245
247
//called
246
- p . pauseDrain = function ( ) {
248
+ Client . prototype . pauseDrain = function ( ) {
247
249
this . _drainPaused = 1 ;
248
250
} ;
249
251
250
252
//resume raising 'drain' event
251
- p . resumeDrain = function ( ) {
253
+ Client . prototype . resumeDrain = function ( ) {
252
254
if ( this . _drainPaused > 1 ) {
253
255
this . emit ( 'drain' ) ;
254
256
}
255
257
this . _drainPaused = 0 ;
256
258
} ;
257
259
258
- p . end = function ( ) {
260
+ Client . prototype . end = function ( ) {
259
261
this . connection . end ( ) ;
260
262
} ;
261
263
0 commit comments