mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-05 18:47:41 +00:00
Escape quotes in identifiers in CQL queries
This commit is contained in:
committed by
GitHub
parent
a9a57f4ba9
commit
5ffa746adb
18
src/Explorer/Tables/CqlUtilities.test.ts
Normal file
18
src/Explorer/Tables/CqlUtilities.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { getQuotedCqlIdentifier } from "./CqlUtilities";
|
||||
|
||||
describe("getQuotedCqlIdentifier", () => {
|
||||
it("undefined id", () => {
|
||||
const result = getQuotedCqlIdentifier(undefined);
|
||||
expect(result).toBe(undefined);
|
||||
});
|
||||
|
||||
it("id with no quotes", () => {
|
||||
const result = getQuotedCqlIdentifier("foo");
|
||||
expect(result).toBe('"foo"');
|
||||
});
|
||||
|
||||
it("id with quotes", () => {
|
||||
const result = getQuotedCqlIdentifier('"foo"');
|
||||
expect(result).toBe('"""foo"""');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user