chad
select / groupBy combined helper
I realize this usecase looks awful, but our API takes an input of a list of fields to group by, which also means it will return those fields in the result. What I have works, but there's a lot of duplication:
but these 3 lines are repeated for each possible parameter a dozen times; and some are more complicated such as extracting multiple fields out of a timestamp.
I would prefer something like this but I can't figure out how to get it to typecheck
Playground here:
https://kyse.link/C4mRA
6 replies