MCPcopy
hub / github.com/electric-sql/pglite / getStmt

Function getStmt

packages/pglite/tests/templating.test.js:96–97  ·  view source on GitHub ↗
(filterVar)

Source from the content-addressed store, hash-verified

94
95 it('should be able to nest templated statements', () => {
96 const getStmt = (filterVar) =>
97 query`SELECT * FROM ${identifier`test`}${filterVar !== undefined ? sql` WHERE ${identifier`foo`} = ${filterVar}` : sql``};`
98
99 expect(getStmt('foo')).toEqual({
100 query: 'SELECT * FROM "test" WHERE "foo" = $1;',

Callers 1

templating.test.jsFile · 0.85

Calls 3

queryFunction · 0.90
identifierFunction · 0.85
sqlFunction · 0.50

Tested by

no test coverage detected