tomjaguarpaw / haskell-opaleye

Other
599 stars 115 forks source link

Support for FILTER clause in aggregate expressions #520

Open remeike opened 2 years ago

remeike commented 2 years ago

So it looks like Opaleye supports ORDER BY clauses in aggregate expressions with the orderAggregate function. I wonder if it would be possible to have support for FILTER clauses (4.2.7.) in aggregate expressions as well?

I imagine the type could look like: filterAggregate :: (a -> Column SqlBool) -> Aggregator a b -> Aggregator a b

tomjaguarpaw commented 2 years ago

Very nice idea! I didn't even know FILTER existed until now. Regrettably I don't think I'll have time to work on this in the near future but happy to advise anyone who wants to work on it.