feat(editor): add ClickHouse SQL highlighting
This commit is contained in:
1 parent
02aea73d28
commit
b4efcebd78
10 files changed
+911
-14
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { sqlSemanticDialectFor } from "@/lib/sql/semantic/dialect";
|
||||
|
||||
describe("ClickHouse semantic dialect", () => {
|
||||
it("takes precedence over the legacy MySQL behavior dialect", () => {
|
||||
const dialect = sqlSemanticDialectFor({
|
||||
databaseType: "clickhouse",
|
||||
dialect: "mysql",
|
||||
});
|
||||
|
||||
expect(dialect.id).toBe("clickhouse");
|
||||
expect(dialect.identifierQuotes).toEqual([
|
||||
{ open: "`", close: "`" },
|
||||
{ open: '"', close: '"' },
|
||||
]);
|
||||
expect(dialect.normalizeIdentifier("EventName")).toBe("EventName");
|
||||
expect(dialect.quoteIdentifier("event`name")).toBe("`event``name`");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user