Skip to content

Commit 55c3b36

Browse files
committed
Use normalizeQueryConfig in native query
1 parent df36bec commit 55c3b36

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

lib/native/client.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,7 @@ Client.prototype.query = function(config, values, callback) {
118118
return config;
119119
}
120120

121-
var conf = { };
122-
123-
//support query('text', ...) style calls
124-
if(typeof config == 'string') {
125-
conf.text = config;
126-
}
127-
128-
//support passing everything in via a config object
129-
if(typeof config == 'object') {
130-
conf.text = config.text;
131-
conf.values = config.values;
132-
conf.name = config.name;
133-
conf.callback = config.callback;
134-
conf.rowMode = config.rowMode;
135-
}
136-
137-
//support query({...}, function() {}) style calls
138-
//& support query(..., ['values'], ...) style calls
139-
if(typeof values == 'function') {
140-
conf.callback = values;
141-
}
142-
else if(util.isArray(values)) {
143-
conf.values = values;
144-
}
145-
if(typeof callback == 'function') {
146-
conf.callback = callback;
147-
}
148-
149-
var query = new NativeQuery(conf);
121+
var query = new NativeQuery(config, values, callback);
150122
this._queryQueue.push(query);
151123
this._pulseQueryQueue();
152124
return query;

lib/native/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./client')
1+
module.exports = require('./client');

0 commit comments

Comments
 (0)