Home / Function/ l1Distance() — drizzle-orm Function Reference

l1Distance() — drizzle-orm Function Reference

Architecture documentation for the l1Distance() function in vector.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  496eff21_614b_aef7_fdb5_605d68914a49["l1Distance()"]
  d155802d_6bf7_144f_94a8_70b957517dac["vector.ts"]
  496eff21_614b_aef7_fdb5_605d68914a49 -->|defined in| d155802d_6bf7_144f_94a8_70b957517dac
  2f117b41_7784_e39d_7d88_f5fa5ffeaa3e["toSql()"]
  496eff21_614b_aef7_fdb5_605d68914a49 -->|calls| 2f117b41_7784_e39d_7d88_f5fa5ffeaa3e
  style 496eff21_614b_aef7_fdb5_605d68914a49 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/sql/functions/vector.ts lines 61–69

export function l1Distance(
	column: SQLWrapper | AnyColumn,
	value: number[] | string[] | TypedQueryBuilder<any> | string,
): SQL {
	if (Array.isArray(value)) {
		return sql`${column} <+> ${toSql(value)}`;
	}
	return sql`${column} <+> ${value}`;
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does l1Distance() do?
l1Distance() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/sql/functions/vector.ts.
Where is l1Distance() defined?
l1Distance() is defined in drizzle-orm/src/sql/functions/vector.ts at line 61.
What does l1Distance() call?
l1Distance() calls 1 function(s): toSql.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free