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

primaryKey() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e17efada_f3d2_b865_7886_6807b6a18c6b["primaryKey()"]
  63d21212_2bf5_401e_92eb_15e737e0575b["primary-keys.ts"]
  e17efada_f3d2_b865_7886_6807b6a18c6b -->|defined in| 63d21212_2bf5_401e_92eb_15e737e0575b
  style e17efada_f3d2_b865_7886_6807b6a18c6b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/mysql-core/primary-keys.ts lines 18–23

export function primaryKey(...config: any) {
	if (config[0].columns) {
		return new PrimaryKeyBuilder(config[0].columns, config[0].name);
	}
	return new PrimaryKeyBuilder(config);
}

Domain

Subdomains

Frequently Asked Questions

What does primaryKey() do?
primaryKey() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/mysql-core/primary-keys.ts.
Where is primaryKey() defined?
primaryKey() is defined in drizzle-orm/src/mysql-core/primary-keys.ts at line 18.

Analyze Your Own Codebase

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

Try Supermodel Free