Home / Class/ PrimaryKey Class — drizzle-orm Architecture

PrimaryKey Class — drizzle-orm Architecture

Architecture documentation for the PrimaryKey class in primary-keys.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  404bcf9f_e559_51d7_3de9_761e035982a9["PrimaryKey"]
  23f0730e_a6b8_4342_cdc4_6f458b4467d7["primary-keys.ts"]
  404bcf9f_e559_51d7_3de9_761e035982a9 -->|defined in| 23f0730e_a6b8_4342_cdc4_6f458b4467d7
  df262010_1be7_cb7f_9f50_d8258d668e0d["constructor()"]
  404bcf9f_e559_51d7_3de9_761e035982a9 -->|method| df262010_1be7_cb7f_9f50_d8258d668e0d
  224cc836_7afd_9a8a_796c_d22d9912517e["getName()"]
  404bcf9f_e559_51d7_3de9_761e035982a9 -->|method| 224cc836_7afd_9a8a_796c_d22d9912517e

Relationship Graph

Source Code

drizzle-orm/src/singlestore-core/primary-keys.ts lines 48–63

export class PrimaryKey {
	static readonly [entityKind]: string = 'SingleStorePrimaryKey';

	readonly columns: SingleStoreColumn[];
	readonly name?: string;

	constructor(readonly table: SingleStoreTable, columns: SingleStoreColumn[], name?: string) {
		this.columns = columns;
		this.name = name;
	}

	getName(): string {
		return this.name
			?? `${this.table[SingleStoreTable.Symbol.Name]}_${this.columns.map((column) => column.name).join('_')}_pk`;
	}
}

Domain

Frequently Asked Questions

What is the PrimaryKey class?
PrimaryKey is a class in the drizzle-orm codebase, defined in drizzle-orm/src/singlestore-core/primary-keys.ts.
Where is PrimaryKey defined?
PrimaryKey is defined in drizzle-orm/src/singlestore-core/primary-keys.ts at line 48.

Analyze Your Own Codebase

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

Try Supermodel Free