MCPcopy
hub / github.com/drizzle-team/drizzle-orm / sql

Function sql

drizzle-orm/src/sql/sql.ts:485–495  ·  drizzle-orm/src/sql/sql.ts::sql
(strings: TemplateStringsArray, ...params: SQLChunk[])

Source from the content-addressed store, hash-verified

483 This type is used to make our lives easier and the type checker happy.
484*/
485export function sql(strings: TemplateStringsArray, ...params: SQLChunk[]): SQL {
486 const queryChunks: SQLChunk[] = [];
487 if (params.length > 0 || (strings.length > 0 && strings[0] !== class="st">'')) {
488 queryChunks.push(new StringChunk(strings[0]!));
489 }
490 for (const [paramIndex, param] of params.entries()) {
491 queryChunks.push(param, new StringChunk(strings[paramIndex + 1]!));
492 }
493
494 return new SQL(queryChunks);
495}
496
497export namespace sql {
498 export function empty(): SQL {

Callers 15

mysql.test.tsFile · 0.90
pg.test.tsFile · 0.90
turso.test.tsFile · 0.90
sqlite.schema.tsFile · 0.90
vercel.test.tsFile · 0.90

Calls

no outgoing calls

Tested by 15

createNorthwindTablesFunction · 0.72
createAllDataTypesTableFunction · 0.72
createNorthwindTablesFunction · 0.72
createAllDataTypesTableFunction · 0.72
toDriverFunction · 0.72
countFunction · 0.72
setupSetOperationTestFunction · 0.72
countFunction · 0.72