MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / compileToSql

Function compileToSql

console/src/api/materialize/index.test.ts:30–35  ·  view source on GitHub ↗
(literal: string)

Source from the content-addressed store, hash-verified

28
29describe("escapedLiteral", () => {
30 const compileToSql = (literal: string) => {
31 return queryBuilder
32 .selectFrom("test" as never)
33 .select(sql`${escapedLiteral(literal)}`.as("value"))
34 .compile().sql;
35 };
36
37 it("should escape a single quote", () => {
38 expect(compileToSql("foo'bar")).toContain("'foo''bar'");

Callers 1

index.test.tsFile · 0.85

Calls 3

escapedLiteralFunction · 0.90
compileMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected