Use normalizeQueryConfig in native query

This commit is contained in:
Brian M. Carlson 2017-06-13 11:23:15 -05:00 committed by Brian C
parent df36bece86
commit 55c3b3691c
2 changed files with 2 additions and 30 deletions

View File

@ -118,35 +118,7 @@ Client.prototype.query = function(config, values, callback) {
return config;
}
var conf = { };
//support query('text', ...) style calls
if(typeof config == 'string') {
conf.text = config;
}
//support passing everything in via a config object
if(typeof config == 'object') {
conf.text = config.text;
conf.values = config.values;
conf.name = config.name;
conf.callback = config.callback;
conf.rowMode = config.rowMode;
}
//support query({...}, function() {}) style calls
//& support query(..., ['values'], ...) style calls
if(typeof values == 'function') {
conf.callback = values;
}
else if(util.isArray(values)) {
conf.values = values;
}
if(typeof callback == 'function') {
conf.callback = callback;
}
var query = new NativeQuery(conf);
var query = new NativeQuery(config, values, callback);
this._queryQueue.push(query);
this._pulseQueryQueue();
return query;

View File

@ -1 +1 @@
module.exports = require('./client')
module.exports = require('./client');