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

Function l1Distance

drizzle-orm/src/sql/functions/vector.ts:61–69  ·  view source on GitHub ↗
(
	column: SQLWrapper | AnyColumn,
	value: number[] | string[] | TypedQueryBuilder<any> | string,
)

Source from the content-addressed store, hash-verified

59 * ```
60 */
61export function l1Distance(
62 column: SQLWrapper | AnyColumn,
63 value: number[] | string[] | TypedQueryBuilder<any> | string,
64): SQL {
65 if (Array.isArray(value)) {
66 return sql`${column} <+> ${toSql(value)}`;
67 }
68 return sql`${column} <+> ${value}`;
69}
70
71/**
72 * Used in sorting and in querying, if used in sorting,

Callers

nothing calls this directly

Calls 2

sqlFunction · 0.90
toSqlFunction · 0.85

Tested by

no test coverage detected