Commit da8696ed by Sven Klemm

fix handling of variable interpolation for IN expresions

parent 21e7b0b9
......@@ -48,7 +48,7 @@ export default class PostgresQuery {
}
quoteLiteral(value) {
return "'" + this.escapeLiteral(value) + "'";
return "'" + value.replace("'", "''") + "'";
}
escapeLiteral(value) {
......@@ -74,7 +74,7 @@ export default class PostgresQuery {
}
let escapedValues = _.map(value, this.quoteLiteral);
return '(' + escapedValues.join(',') + ')';
return escapedValues.join(',');
}
render(interpolate?) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment