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

Function avgDistinct

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

Source from the content-addressed store, hash-verified

65 * @see avg to get the average of all non-null values in `expression`, including duplicates
66 */
67export function avgDistinct(expression: SQLWrapper): SQL<string | null> {
68 return sql`avg(distinct ${expression})`.mapWith(String);
69}
70
71/**
72 * Returns the sum of all non-null 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