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

on() — drizzle-orm Function Reference

Architecture documentation for the on() function in indexes.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  d887a4a7_072c_ecf4_9735_b7a9c3882c23["on()"]
  02429881_d882_e62b_a969_f07e1c11f572["IndexBuilderOn"]
  d887a4a7_072c_ecf4_9735_b7a9c3882c23 -->|defined in| 02429881_d882_e62b_a969_f07e1c11f572
  style d887a4a7_072c_ecf4_9735_b7a9c3882c23 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel-core/indexes.ts lines 122–137

	on(...columns: [Partial<GelExtraConfigColumn> | SQL, ...Partial<GelExtraConfigColumn | SQL>[]]): IndexBuilder {
		return new IndexBuilder(
			columns.map((it) => {
				if (is(it, SQL)) {
					return it;
				}
				it = it as GelExtraConfigColumn;
				const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType!, it.indexConfig!);
				it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
				return clonedIndexedColumn;
			}),
			this.unique,
			false,
			this.name,
		);
	}

Domain

Subdomains

Frequently Asked Questions

What does on() do?
on() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel-core/indexes.ts.
Where is on() defined?
on() is defined in drizzle-orm/src/gel-core/indexes.ts at line 122.

Analyze Your Own Codebase

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

Try Supermodel Free