diff --git a/lib/query.js b/lib/query.js index 9e474d12..36d52ba7 100644 --- a/lib/query.js +++ b/lib/query.js @@ -65,11 +65,9 @@ Query.prototype.requiresPreparation = function() { if(this.rows) { return true; } //don't prepare empty text queries if(!this.text) { return false; } - //binary should be prepared to specify results should be in binary - //unless there are no parameters - if(this.binary && !this.values) { return false; } //prepare if there are values - return (this.values || 0).length > 0; + if(!this.values) { return false; } + return this.values.length > 0; }; diff --git a/lib/utils.js b/lib/utils.js index 017aa5cd..861b7c5b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -64,9 +64,6 @@ var prepareValue = function(val, seen) { if(typeof val === 'object') { return prepareObject(val, seen); } - if (typeof val === 'undefined') { - throw new Error('SQL queries with undefined where clause option'); - } return val.toString(); };