Home / Class/ IndexBuilder Class — drizzle-orm Architecture

IndexBuilder Class — drizzle-orm Architecture

Architecture documentation for the IndexBuilder class in indexes.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  5a25fdd1_f316_6702_af4d_9a37c66d3845["IndexBuilder"]
  a406baef_d8bd_9bc9_efcd_e7c1450622b0["indexes.ts"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|defined in| a406baef_d8bd_9bc9_efcd_e7c1450622b0
  1fb1e54c_c08c_88c7_e95d_4aba5b1cb55e["constructor()"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|method| 1fb1e54c_c08c_88c7_e95d_4aba5b1cb55e
  6577d4f9_5934_3bbf_0077_b0449fef24a3["concurrently()"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|method| 6577d4f9_5934_3bbf_0077_b0449fef24a3
  e4c5783e_b337_0b69_21fb_1ea67e60e478["with()"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|method| e4c5783e_b337_0b69_21fb_1ea67e60e478
  292389c9_5cc9_ecf0_8709_b82dca53c24b["where()"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|method| 292389c9_5cc9_ecf0_8709_b82dca53c24b
  45461262_96f0_1d40_22f0_d5be2b5732ea["build()"]
  5a25fdd1_f316_6702_af4d_9a37c66d3845 -->|method| 45461262_96f0_1d40_22f0_d5be2b5732ea

Relationship Graph

Source Code

drizzle-orm/src/pg-core/indexes.ts lines 188–229

export class IndexBuilder implements AnyIndexBuilder {
	static readonly [entityKind]: string = 'PgIndexBuilder';

	/** @internal */
	config: IndexConfig;

	constructor(
		columns: Partial<IndexedColumn | SQL>[],
		unique: boolean,
		only: boolean,
		name?: string,
		method: string = 'btree',
	) {
		this.config = {
			name,
			columns,
			unique,
			only,
			method,
		};
	}

	concurrently(): this {
		this.config.concurrently = true;
		return this;
	}

	with(obj: Record<string, any>): this {
		this.config.with = obj;
		return this;
	}

	where(condition: SQL): this {
		this.config.where = condition;
		return this;
	}

	/** @internal */
	build(table: PgTable): Index {
		return new Index(this.config, table);
	}
}

Domain

Frequently Asked Questions

What is the IndexBuilder class?
IndexBuilder is a class in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/indexes.ts.
Where is IndexBuilder defined?
IndexBuilder is defined in drizzle-orm/src/pg-core/indexes.ts at line 188.

Analyze Your Own Codebase

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

Try Supermodel Free