@@ -7,7 +7,7 @@ var utils = require(__dirname + '/utils');
7
7
8
8
var Query = function ( config , values , callback ) {
9
9
// use of "new" optional
10
- if ( ! ( this instanceof Query ) ) return new Query ( config , values , callback ) ;
10
+ if ( ! ( this instanceof Query ) ) { return new Query ( config , values , callback ) ; }
11
11
12
12
config = utils . normalizeQueryConfig ( config , values , callback ) ;
13
13
@@ -19,7 +19,7 @@ var Query = function(config, values, callback) {
19
19
this . binary = config . binary ;
20
20
this . stream = config . stream ;
21
21
//use unique portal name each time
22
- this . portal = config . portal || ""
22
+ this . portal = config . portal || "" ;
23
23
this . callback = config . callback ;
24
24
this . _fieldNames = [ ] ;
25
25
this . _fieldConverters = [ ] ;
@@ -34,15 +34,15 @@ var p = Query.prototype;
34
34
35
35
p . requiresPreparation = function ( ) {
36
36
//named queries must always be prepared
37
- if ( this . name ) return true ;
37
+ if ( this . name ) { return true ; }
38
38
//always prepare if there are max number of rows expected per
39
39
//portal execution
40
- if ( this . rows ) return true ;
40
+ if ( this . rows ) { return true ; }
41
41
//don't prepare empty text queries
42
- if ( ! this . text ) return false ;
42
+ if ( ! this . text ) { return false ; }
43
43
//binary should be prepared to specify results should be in binary
44
44
//unless there are no parameters
45
- if ( this . binary && ! this . values ) return false ;
45
+ if ( this . binary && ! this . values ) { return false ; }
46
46
//prepare if there are values
47
47
return ( this . values || 0 ) . length > 0 ;
48
48
} ;
@@ -64,7 +64,7 @@ p.handleRowDescription = function(msg) {
64
64
var format = field . format ;
65
65
this . _fieldNames [ i ] = field . name ;
66
66
this . _fieldConverters [ i ] = Types . getTypeParser ( field . dataTypeID , format ) ;
67
- } ;
67
+ }
68
68
} ;
69
69
70
70
p . handleDataRow = function ( msg ) {
@@ -110,7 +110,7 @@ p.handleError = function(err) {
110
110
//if callback supplied do not emit error event as uncaught error
111
111
//events will bubble up to node process
112
112
if ( this . callback ) {
113
- this . callback ( err )
113
+ this . callback ( err ) ;
114
114
} else {
115
115
this . emit ( 'error' , err ) ;
116
116
}
@@ -188,5 +188,5 @@ p.handleCopyFromChunk = function (chunk) {
188
188
//if there are no stream (for example when copy to query was sent by
189
189
//query method instead of copyTo) error will be handled
190
190
//on copyOutResponse event, so silently ignore this error here
191
- }
191
+ } ;
192
192
module . exports = Query ;
0 commit comments