Escape quotes in identifiers in CQL queries

This commit is contained in:
Armando Trejo Oliver
2020-10-12 11:00:11 -07:00
committed by GitHub
parent a9a57f4ba9
commit 5ffa746adb
5 changed files with 40 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
export function getQuotedCqlIdentifier(identifier: string): string {
let result = identifier;
if (!identifier) {
return result;
}
if (identifier.includes('"')) {
result = identifier.replace(/"/g, '""');
}
return `"${result}"`;
}