Fix quoting to handle non-string values

This commit is contained in:
Sven Klemm 2018-09-07 10:21:10 +02:00
parent b070784b8a
commit 6b863e3b0f

View File

@ -44,15 +44,15 @@ export default class PostgresQuery {
} }
quoteIdentifier(value) { quoteIdentifier(value) {
return '"' + value.replace(/"/g, '""') + '"'; return '"' + String(value).replace(/"/g, '""') + '"';
} }
quoteLiteral(value) { quoteLiteral(value) {
return "'" + value.replace(/'/g, "''") + "'"; return "'" + String(value).replace(/'/g, "''") + "'";
} }
escapeLiteral(value) { escapeLiteral(value) {
return value.replace(/'/g, "''"); return String(value).replace(/'/g, "''");
} }
hasTimeGroup() { hasTimeGroup() {