Permalink
Browse files

Fixed #19

* DBSelect : we now handle "falsy" params correctly
* DBSelect : a "null" param is now converted to NULL in the SQL String
* auto formatting on dbSelect.js
  • Loading branch information...
1 parent a3b1b79 commit a2e1508a4b45bf5683a26e6db052ed4f4ffcad5a @DrBenton committed Jan 13, 2014
@@ -239,6 +239,8 @@ Adapter.prototype.escape = function( value )
return value.getStr();
else if( typeof(value)=='string' )
return "'" + this._dbClient.escapeSync( value ) + "'";
+ else if( value===null )
+ return 'NULL';
else
return value;
};
@@ -259,6 +259,8 @@ Adapter.prototype.escape = function( value )
return value.getStr();
else if( typeof(value)=='string' )
return this._dbClient.escape( value );
+ else if( value===null )
+ return 'NULL';
else
return value;
};
@@ -230,6 +230,8 @@ Adapter.prototype.escape = function( value )
return value.getStr();
else if( typeof(value)=='string' )
return "'" + value.replace(/'/g, "''") + "'";
+ else if( value===null )
+ return 'NULL';
else
return value;
};
@@ -194,6 +194,8 @@ Adapter.prototype.escape = function( value )
return value.getStr();
else if( typeof(value)=='string' )
return "'" + value.replace(/'/g, "''") + "'";
+ else if( value===null )
+ return 'NULL';
else
return value;
};
Oops, something went wrong.

0 comments on commit a2e1508

Please sign in to comment.