count() — drizzle-orm Function Reference
Architecture documentation for the count() function in aggregate.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD d895d7d4_2394_4307_94eb_389073534806["count()"] ddea600c_c886_0da9_1354_46365d17b567["aggregate.ts"] d895d7d4_2394_4307_94eb_389073534806 -->|defined in| ddea600c_c886_0da9_1354_46365d17b567 e4abb7b5_3222_459d_a97f_5b7ad99dda61["countDistinct()"] e4abb7b5_3222_459d_a97f_5b7ad99dda61 -->|calls| d895d7d4_2394_4307_94eb_389073534806 8b5cf4e3_47cf_9aff_6725_1e5edcbd7a9f["raw()"] d895d7d4_2394_4307_94eb_389073534806 -->|calls| 8b5cf4e3_47cf_9aff_6725_1e5edcbd7a9f 932d6924_b2b0_6352_42f7_220855d521b7["mapWith()"] d895d7d4_2394_4307_94eb_389073534806 -->|calls| 932d6924_b2b0_6352_42f7_220855d521b7 style d895d7d4_2394_4307_94eb_389073534806 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/sql/functions/aggregate.ts lines 19–21
export function count(expression?: SQLWrapper): SQL<number> {
return sql`count(${expression || sql.raw('*')})`.mapWith(Number);
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does count() do?
count() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/sql/functions/aggregate.ts.
Where is count() defined?
count() is defined in drizzle-orm/src/sql/functions/aggregate.ts at line 19.
What does count() call?
count() calls 2 function(s): mapWith, raw.
What calls count()?
count() is called by 1 function(s): countDistinct.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free