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
  68eeca43_0d28_52b0_6793_9c22d90df1aa["getName()"]
  9d0c8b0b_4a31_bd3a_bd59_19586ec9f8d8["ForeignKey"]
  68eeca43_0d28_52b0_6793_9c22d90df1aa -->|defined in| 9d0c8b0b_4a31_bd3a_bd59_19586ec9f8d8
  style 68eeca43_0d28_52b0_6793_9c22d90df1aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-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/pg-core/foreign-keys.ts.
Where is getName() defined?
getName() is defined in drizzle-orm/src/pg-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