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
  fef4ebe5_bcb7_9d8a_6349_040e4256d85e["primaryKey()"]
  a7ff59de_fcfb_68fe_6665_16d01fc2937f["primary-keys.ts"]
  fef4ebe5_bcb7_9d8a_6349_040e4256d85e -->|defined in| a7ff59de_fcfb_68fe_6665_16d01fc2937f
  style fef4ebe5_bcb7_9d8a_6349_040e4256d85e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/sqlite-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/sqlite-core/primary-keys.ts.
Where is primaryKey() defined?
primaryKey() is defined in drizzle-orm/src/sqlite-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