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

constructor() — drizzle-orm Function Reference

Architecture documentation for the constructor() function in foreign-keys.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  7b69d4ac_ec6e_2006_3fdf_59fc7b1d9171["constructor()"]
  dbda35af_725c_bbfb_ce7e_01f35541cefa["ForeignKeyBuilder"]
  7b69d4ac_ec6e_2006_3fdf_59fc7b1d9171 -->|defined in| dbda35af_725c_bbfb_ce7e_01f35541cefa
  2a1b0141_c757_adbd_acdc_538fe2d453b7["constructor()"]
  2a1b0141_c757_adbd_acdc_538fe2d453b7 -->|calls| 7b69d4ac_ec6e_2006_3fdf_59fc7b1d9171
  2a1b0141_c757_adbd_acdc_538fe2d453b7["constructor()"]
  7b69d4ac_ec6e_2006_3fdf_59fc7b1d9171 -->|calls| 2a1b0141_c757_adbd_acdc_538fe2d453b7
  style 7b69d4ac_ec6e_2006_3fdf_59fc7b1d9171 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel-core/foreign-keys.ts lines 27–46

	constructor(
		config: () => {
			name?: string;
			columns: GelColumn[];
			foreignColumns: GelColumn[];
		},
		actions?: {
			onUpdate?: UpdateDeleteAction;
			onDelete?: UpdateDeleteAction;
		} | undefined,
	) {
		this.reference = () => {
			const { name, columns, foreignColumns } = config();
			return { name, columns, foreignTable: foreignColumns[0]!.table as GelTable, foreignColumns };
		};
		if (actions) {
			this._onUpdate = actions.onUpdate;
			this._onDelete = actions.onDelete;
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel-core/foreign-keys.ts.
Where is constructor() defined?
constructor() is defined in drizzle-orm/src/gel-core/foreign-keys.ts at line 27.
What does constructor() call?
constructor() calls 1 function(s): constructor.
What calls constructor()?
constructor() is called by 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free