mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-26 08:21:33 +01:00
Escape quotes in identifiers in CQL queries
This commit is contained in:
committed by
GitHub
parent
a9a57f4ba9
commit
5ffa746adb
12
src/Explorer/Tables/CqlUtilities.ts
Normal file
12
src/Explorer/Tables/CqlUtilities.ts
Normal 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}"`;
|
||||
}
|
||||
Reference in New Issue
Block a user