Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add ( ) wrapper of 'IN' statement

  • Loading branch information...
commit 823820ca6d3c7356495e9b820ce76f9db8765881 1 parent 1bbb770
Buwei Chiu authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 index.js
6 index.js
View
@@ -234,7 +234,11 @@ GenericObject.prototype._whereClauseBuilder = function(options) {
options.where.map(function(value) {
if( Array.isArray(value) ) {
if ( value.length === 3 ) { // field, opeator, value
- _sql_where += " `" + value[0] + "` " + value[1] + " " + sqlstring.escape(value[2]);
+ if(value[1] === "IN") {
+ _sql_where += " `" + value[0] + "` " + value[1] + " (" +sqlstring.escape(value[2]) + ")";
+ } else {
+ _sql_where += " `" + value[0] + "` " + value[1] + " " +sqlstring.escape(value[2]);
+ }
}
} else {
_sql_where += " " + value + " ";
Please sign in to comment.
Something went wrong with that request. Please try again.