MCPcopy
hub / github.com/drizzle-team/drizzle-orm / avg

Function avg

drizzle-orm/src/sql/functions/aggregate.ts:51–53  ·  view source on GitHub ↗
(expression: SQLWrapper)

Source from the content-addressed store, hash-verified

49 * @see avgDistinct to get the average of all non-null and non-duplicate values in `expression`
50 */
51export function avg(expression: SQLWrapper): SQL<string | null> {
52 return sql`avg(${expression})`.mapWith(String);
53}
54
55/**
56 * Returns the average (arithmetic mean) of all non-null and non-duplicate values in `expression`.

Callers 7

testsFunction · 0.90
testsFunction · 0.90
testsFunction · 0.90
aggregatFunctionAvgMethod · 0.90
gel.test.tsFile · 0.90
bun-sql.test.tsFile · 0.90
testsFunction · 0.90

Calls 2

sqlFunction · 0.90
mapWithMethod · 0.80

Tested by

no test coverage detected