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
  c009b554_f184_1c54_fa5b_bf0a0e5df73f["buildCount()"]
  7ca41881_9524_bd95_d93b_aa44d5e89fa7["MySqlCountBuilder"]
  c009b554_f184_1c54_fa5b_bf0a0e5df73f -->|defined in| 7ca41881_9524_bd95_d93b_aa44d5e89fa7
  6d22c227_e20e_6c6f_6c2b_f80c229811b3["constructor()"]
  6d22c227_e20e_6c6f_6c2b_f80c229811b3 -->|calls| c009b554_f184_1c54_fa5b_bf0a0e5df73f
  style c009b554_f184_1c54_fa5b_bf0a0e5df73f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/mysql-core/query-builders/count.ts lines 24–29

	private static buildCount(
		source: MySqlTable | MySqlViewBase | 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/mysql-core/query-builders/count.ts.
Where is buildCount() defined?
buildCount() is defined in drizzle-orm/src/mysql-core/query-builders/count.ts at line 24.
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