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

Function countDistinct

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

Source from the content-addressed store, hash-verified

33 * @see count to get the number of values in `expression`, including duplicates
34 */
35export function countDistinct(expression: SQLWrapper): SQL<number> {
36 return sql`count(distinct ${expression})`.mapWith(Number);
37}
38
39/**
40 * Returns the average (arithmetic mean) of all non-null values in `expression`.

Callers 7

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