chad
select / groupBy combined helper
I have another approach for anyone who finds this. It's a bit of a failed experiment for my use-case but for a simpler one it might work ok:
https://kyse.link/gz42N
Basically I define a type that can hold a select and a groupBy
and then some helpers that can infer the right types at the call-site, for example:
and if you have a list of these you can
.map(f => f.select)
to get a list you can pass to db.select(...)
plus .map(f => f.groupBy)
to pass to db.groupBy(...)
.6 replies