mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00: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