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

Function sumDistinct

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

Source from the content-addressed store, hash-verified

97 * @see sum to get the sum of all non-null values in `expression`, including duplicates
98 */
99export function sumDistinct(expression: SQLWrapper): SQL<string | null> {
100 return sql`sum(distinct ${expression})`.mapWith(String);
101}
102
103/**
104 * Returns the maximum value in `expression`.

Callers 7

testsFunction · 0.90
testsFunction · 0.90
testsFunction · 0.90
aggregateFunctionSumMethod · 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