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

Function inArray

drizzle-orm/src/sql/expressions/conditions.ts:281–293  ·  view source on GitHub ↗
(
	column: SQLWrapper,
	values: ReadonlyArray<unknown | Placeholder> | SQLWrapper,
)

Source from the content-addressed store, hash-verified

279 values: ReadonlyArray<unknown | Placeholder> | SQLWrapper,
280): SQL;
281export function inArray(
282 column: SQLWrapper,
283 values: ReadonlyArray<unknown | Placeholder> | SQLWrapper,
284): SQL {
285 if (Array.isArray(values)) {
286 if (values.length === 0) {
287 return sql`false`;
288 }
289 return sql`${column} in ${values.map((v) => bindIfParam(v, column))}`;
290 }
291
292 return sql`${column} in ${bindIfParam(values, column)}`;
293}
294
295/**
296 * Test whether the first parameter, a column or expression,

Callers 15

testsFunction · 0.90
testsFunction · 0.90
awsdatapi.test.tsFile · 0.90
testsFunction · 0.90
withSelectMethod · 0.90
gel.test.tsFile · 0.90
bun-sql.test.tsFile · 0.90
testsFunction · 0.90
with.tsFile · 0.90

Calls 2

sqlFunction · 0.90
bindIfParamFunction · 0.85

Tested by

no test coverage detected