fix quoting
This commit is contained in:
@@ -37,22 +37,22 @@ export default class PostgresQuery {
|
||||
// remove identifier quoting from identifier to use in metadata queries
|
||||
unquoteIdentifier(value) {
|
||||
if (value[0] === '"' && value[value.length - 1] === '"') {
|
||||
return value.substring(1, value.length - 1).replace('""', '"');
|
||||
return value.substring(1, value.length - 1).replace(/""/g, '"');
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
quoteIdentifier(value) {
|
||||
return '"' + value.replace('"', '""') + '"';
|
||||
return '"' + value.replace(/"/g, '""') + '"';
|
||||
}
|
||||
|
||||
quoteLiteral(value) {
|
||||
return "'" + value.replace("'", "''") + "'";
|
||||
return "'" + value.replace(/'/g, "''") + "'";
|
||||
}
|
||||
|
||||
escapeLiteral(value) {
|
||||
return value.replace("'", "''");
|
||||
return value.replace(/'/g, "''");
|
||||
}
|
||||
|
||||
hasTimeGroup() {
|
||||
|
||||
@@ -385,7 +385,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
|
||||
if (addAlias) {
|
||||
// set initial alias name to column name
|
||||
partModel = sqlPart.create({ type: 'alias', params: [selectParts[0].params[0].replace('"', '')] });
|
||||
partModel = sqlPart.create({ type: 'alias', params: [selectParts[0].params[0].replace(/"/g, '')] });
|
||||
if (selectParts[selectParts.length - 1].def.type === 'alias') {
|
||||
selectParts[selectParts.length - 1] = partModel;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user