MCPcopy Index your code
hub / github.com/Openpanel-dev/openpanel / getWith

Function getWith

packages/db/src/sql-builder.ts:51–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 Object.keys(sb.joins).length ? join(sb.joins, ' ') : '';
50 const getFill = () => (sb.fill ? `WITH FILL ${sb.fill}` : '');
51 const getWith = () => {
52 const cteEntries = Object.entries(sb.ctes);
53 if (cteEntries.length === 0) return '';
54 const cteClauses = cteEntries.map(
55 ([name, query]) => `${name} AS (${query})`,
56 );
57 return `WITH ${cteClauses.join(', ')} `;
58 };
59
60 return {
61 sb,

Callers 2

createSqlBuilderFunction · 0.85
getChartSqlFunction · 0.85

Calls 2

joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected