Open aleclarson opened 2 years ago
If an aggregate function is used within a db.select call, you need GROUP BY to include non-aggregate selections.
db.select
GROUP BY
defineFunction
Aggregate
Output
We'll probably add a groupBy helper function for use in the selector function.
groupBy
db.select(t.user(user => [ groupBy(user.id), pg.avg(user.followerCount), ]))
If an aggregate function is used within a
db.select
call, you needGROUP BY
to include non-aggregate selections.Current progress
defineFunction
calls use theAggregate
type instead ofOutput
in their type signaturesAggregate
and non-aggregate types