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

getName() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  05ffbc57_235f_78fa_087e_644883ce2d6d["getName()"]
  73e29a69_cd8c_3513_4994_53e49eddb654["ForeignKey"]
  05ffbc57_235f_78fa_087e_644883ce2d6d -->|defined in| 73e29a69_cd8c_3513_4994_53e49eddb654
  style 05ffbc57_235f_78fa_087e_644883ce2d6d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel-core/foreign-keys.ts lines 79–90

	getName(): string {
		const { name, columns, foreignColumns } = this.reference();
		const columnNames = columns.map((column) => column.name);
		const foreignColumnNames = foreignColumns.map((column) => column.name);
		const chunks = [
			this.table[TableName],
			...columnNames,
			foreignColumns[0]!.table[TableName],
			...foreignColumnNames,
		];
		return name ?? `${chunks.join('_')}_fk`;
	}

Domain

Subdomains

Frequently Asked Questions

What does getName() do?
getName() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel-core/foreign-keys.ts.
Where is getName() defined?
getName() is defined in drizzle-orm/src/gel-core/foreign-keys.ts at line 79.

Analyze Your Own Codebase

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

Try Supermodel Free