import { kysely } from "https://deno.land/x/kysely_postgrs_js_dialect@v0.27.4/deps.ts";
const { AggregateFunctionBuilder } = kysely;
Adds a distinct
clause inside the function.
Examples
const result = await db
.selectFrom('person')
.select((eb) =>
eb.fn.count<number>('first_name').distinct().as('first_name_count')
)
.executeTakeFirstOrThrow()
The generated SQL (PostgreSQL):
select count(distinct "first_name") as "first_name_count"
from "person"
Returns
AggregateFunctionBuilder<DB, TB, O>