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
  1bc6938c_24de_a7d3_282f_dd782b7f649b["on()"]
  149e5992_d166_053e_4f10_4c8e54d56c14["IndexBuilderOn"]
  1bc6938c_24de_a7d3_282f_dd782b7f649b -->|defined in| 149e5992_d166_053e_4f10_4c8e54d56c14
  style 1bc6938c_24de_a7d3_282f_dd782b7f649b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-core/indexes.ts lines 114–129

	on(...columns: [Partial<ExtraConfigColumn> | SQL, ...Partial<ExtraConfigColumn | SQL>[]]): IndexBuilder {
		return new IndexBuilder(
			columns.map((it) => {
				if (is(it, SQL)) {
					return it;
				}
				it = it as ExtraConfigColumn;
				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/pg-core/indexes.ts.
Where is on() defined?
on() is defined in drizzle-orm/src/pg-core/indexes.ts at line 114.

Analyze Your Own Codebase

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

Try Supermodel Free