Skip to content

Commit

Permalink
Adds support for ?? escape sequence to escape identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
dresende committed Mar 13, 2013
1 parent 404b165 commit 9517585
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/protocol/SqlString.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ SqlString.arrayToList = function(array, timeZone) {
SqlString.format = function(sql, values, timeZone) {
values = [].concat(values);

return sql.replace(/\?/g, function(match) {
return sql.replace(/\?\??/g, function(match) {
if (!values.length) {
return match;
}

if (match == "??") {
return SqlString.escapeId(values.shift());
}
return SqlString.escape(values.shift(), false, timeZone);
});
};
Expand Down

0 comments on commit 9517585

Please sign in to comment.