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 4c28b118_174e_f883_d4c7_ae46c368b285["primaryKey()"] 87a357d2_c2ec_b04d_8912_3b8be2a92815["primary-keys.ts"] 4c28b118_174e_f883_d4c7_ae46c368b285 -->|defined in| 87a357d2_c2ec_b04d_8912_3b8be2a92815 style 4c28b118_174e_f883_d4c7_ae46c368b285 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/pg-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
Defined In
Source
Frequently Asked Questions
What does primaryKey() do?
primaryKey() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/primary-keys.ts.
Where is primaryKey() defined?
primaryKey() is defined in drizzle-orm/src/pg-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