From 55c3b3691cc3e095aa7a4b6a8d27daddd2360f9a Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Tue, 13 Jun 2017 11:23:15 -0500 Subject: [PATCH] Use normalizeQueryConfig in native query --- lib/native/client.js | 30 +----------------------------- lib/native/index.js | 2 +- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/lib/native/client.js b/lib/native/client.js index c76953d0..e7e17b08 100644 --- a/lib/native/client.js +++ b/lib/native/client.js @@ -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; diff --git a/lib/native/index.js b/lib/native/index.js index a35a2733..ccf987e3 100644 --- a/lib/native/index.js +++ b/lib/native/index.js @@ -1 +1 @@ -module.exports = require('./client') +module.exports = require('./client');