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

avg() — drizzle-orm Function Reference

Architecture documentation for the avg() function in aggregate.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  a6ccbe84_d858_d8e6_14ce_daa91121d039["avg()"]
  ddea600c_c886_0da9_1354_46365d17b567["aggregate.ts"]
  a6ccbe84_d858_d8e6_14ce_daa91121d039 -->|defined in| ddea600c_c886_0da9_1354_46365d17b567
  88141b80_4708_eeb4_9351_ce9d4d923552["avgDistinct()"]
  88141b80_4708_eeb4_9351_ce9d4d923552 -->|calls| a6ccbe84_d858_d8e6_14ce_daa91121d039
  932d6924_b2b0_6352_42f7_220855d521b7["mapWith()"]
  a6ccbe84_d858_d8e6_14ce_daa91121d039 -->|calls| 932d6924_b2b0_6352_42f7_220855d521b7
  style a6ccbe84_d858_d8e6_14ce_daa91121d039 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/sql/functions/aggregate.ts lines 51–53

export function avg(expression: SQLWrapper): SQL<string | null> {
	return sql`avg(${expression})`.mapWith(String);
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does avg() do?
avg() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/sql/functions/aggregate.ts.
Where is avg() defined?
avg() is defined in drizzle-orm/src/sql/functions/aggregate.ts at line 51.
What does avg() call?
avg() calls 1 function(s): mapWith.
What calls avg()?
avg() is called by 1 function(s): avgDistinct.

Analyze Your Own Codebase

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

Try Supermodel Free