MCPcopy
hub / github.com/msgbyte/tianji / unwrapSQL

Function unwrapSQL

src/server/utils/prisma.ts:49–56  ·  view source on GitHub ↗
(sql: Prisma.Sql)

Source from the content-addressed store, hash-verified

47}
48
49export function unwrapSQL(sql: Prisma.Sql) {
50 const unwrapSqlText = sql.text.replace(/\$(\d+)/g, (match, group1) => {
51 const index = parseInt(group1, 10) - 1;
52 return `'${sql.values[index]}'`;
53 });
54
55 return unwrapSqlText;
56}
57
58export function printSQL(sql: Prisma.Sql) {
59 const unwrapSqlText = unwrapSQL(sql);

Callers 10

printSQLFunction · 0.85
aiGateway.spec.tsFile · 0.85
survey.spec.tsFile · 0.85
website.spec.tsFile · 0.85
retention.spec.tsFile · 0.85
wideTable.spec.tsFile · 0.85
longTable.spec.tsFile · 0.85
getWebsiteSessionMetricsFunction · 0.85
getWorkspaceWebsiteStatsFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected