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

buildCount() — drizzle-orm Function Reference

Architecture documentation for the buildCount() function in count.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  2568b929_2fae_ea77_776e_7ab13ad1fa55["buildCount()"]
  ac948e16_8fee_2312_8b12_6929b5a7ee06["PgCountBuilder"]
  2568b929_2fae_ea77_776e_7ab13ad1fa55 -->|defined in| ac948e16_8fee_2312_8b12_6929b5a7ee06
  ecf48022_cd3e_19f1_4ee4_dda956fe842f["constructor()"]
  ecf48022_cd3e_19f1_4ee4_dda956fe842f -->|calls| 2568b929_2fae_ea77_776e_7ab13ad1fa55
  style 2568b929_2fae_ea77_776e_7ab13ad1fa55 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-core/query-builders/count.ts lines 25–30

	private static buildCount(
		source: PgTable | SQL | SQLWrapper,
		filters?: SQL<unknown>,
	): SQL<number> {
		return sql<number>`select count(*) as count from ${source}${sql.raw(' where ').if(filters)}${filters};`;
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does buildCount() do?
buildCount() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/query-builders/count.ts.
Where is buildCount() defined?
buildCount() is defined in drizzle-orm/src/pg-core/query-builders/count.ts at line 25.
What calls buildCount()?
buildCount() is called by 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free