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

onOnly() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b48a7e0c_36f0_61b4_453e_15923a676328["onOnly()"]
  149e5992_d166_053e_4f10_4c8e54d56c14["IndexBuilderOn"]
  b48a7e0c_36f0_61b4_453e_15923a676328 -->|defined in| 149e5992_d166_053e_4f10_4c8e54d56c14
  style b48a7e0c_36f0_61b4_453e_15923a676328 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-core/indexes.ts lines 131–146

	onOnly(...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 = it.defaultConfig;
				return clonedIndexedColumn;
			}),
			this.unique,
			true,
			this.name,
		);
	}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free