Home / File/ expressions.ts — drizzle-orm Source File

expressions.ts — drizzle-orm Source File

Architecture documentation for expressions.ts, a typescript file in the drizzle-orm codebase. 3 imports, 0 dependents.

File typescript DrizzleORM SQLDialects 3 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  e8f97fa4_bf5a_12d3_43e4_1bb26ba9c09b["expressions.ts"]
  5c46beaf_8b59_d2e3_def3_8af6daf1fccd["index.ts"]
  e8f97fa4_bf5a_12d3_43e4_1bb26ba9c09b --> 5c46beaf_8b59_d2e3_def3_8af6daf1fccd
  be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd["sql.ts"]
  e8f97fa4_bf5a_12d3_43e4_1bb26ba9c09b --> be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd
  21a1af42_6b20_ae23_eb1a_f0f50e662d62["index.ts"]
  e8f97fa4_bf5a_12d3_43e4_1bb26ba9c09b --> 21a1af42_6b20_ae23_eb1a_f0f50e662d62
  style e8f97fa4_bf5a_12d3_43e4_1bb26ba9c09b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { bindIfParam } from '~/sql/expressions/index.ts';
import type { SQL, SQLChunk, SQLWrapper } from '~/sql/sql.ts';
import { sql } from '~/sql/sql.ts';
import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts';

export * from '~/sql/expressions/index.ts';

export function concat(column: SQLiteColumn | SQL.Aliased, value: string | SQLWrapper): SQL {
	return sql`${column} || ${bindIfParam(value, column)}`;
}

export function substring(
	column: SQLiteColumn | SQL.Aliased,
	{ from, for: _for }: { from?: number | SQLWrapper; for?: number | SQLWrapper },
): SQL {
	const chunks: SQLChunk[] = [sql`substring(`, column];
	if (from !== undefined) {
		chunks.push(sql` from `, bindIfParam(from, column));
	}
	if (_for !== undefined) {
		chunks.push(sql` for `, bindIfParam(_for, column));
	}
	chunks.push(sql`)`);
	return sql.join(chunks);
}

export function rowId(): SQL<number> {
	return sql<number>`rowid`;
}

Domain

Subdomains

Dependencies

  • index.ts
  • index.ts
  • sql.ts

Frequently Asked Questions

What does expressions.ts do?
expressions.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, SQLDialects subdomain.
What functions are defined in expressions.ts?
expressions.ts defines 3 function(s): concat, rowId, substring.
What does expressions.ts depend on?
expressions.ts imports 3 module(s): index.ts, index.ts, sql.ts.
Where is expressions.ts in the architecture?
expressions.ts is located at drizzle-orm/src/sqlite-core/expressions.ts (domain: DrizzleORM, subdomain: SQLDialects, directory: drizzle-orm/src/sqlite-core).

Analyze Your Own Codebase

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

Try Supermodel Free