We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc30cc5 commit ea6cc98Copy full SHA for ea6cc98
machines/send-native-query.js
@@ -120,14 +120,17 @@ module.exports = {
120
// Process SQL template, escaping bindings.
121
// This converts `$1`, `$2`, etc. into the escaped binding.
122
sql = sql.replace(/\$[1-9][0-9]*/g, function (substr){
123
+
124
// e.g. `'$3'` => `'3'` => `3` => `2`
125
var idx = +( substr.slice(1) ) - 1;
126
+ // console.log('idx:',idx);
127
128
// If no such binding exists, then just leave the original
129
// template string (e.g. "$3") alone.
130
if (idx >= bindings.length) {
131
return substr;
132
}
133
+ // console.log('bindings[idx]:',bindings[idx]);
134
135
// But otherwise, replace it with the escaped binding.
136
return inputs.connection.escape(bindings[idx]);
0 commit comments