Expose arg_with
PR Info
- Closes https://github.com/SeaQL/sea-query/issues/901
Changes
- Changed
arg_withtopubto specifyFuncArgMod
what do you need this method for? can you instead add a method similar to fn array_agg_distinct?
Thank you for your reply!
In my use case, I dynamically generate SQL with sea-query based on user requests.
While I understand that actual use cases are limited, I want to allow users to use DISTINCT with aggregate functions like SUM / AVG as long as it's valid SQL.
Is the reason you don't want to make args_with public to prevent invalid SQL from being generated for non-aggregate functions like ABS?
I could add xxx_distinct for all aggregate functions, but since I noticed that raw DISTINCT can be easily applied with cust_with_expr, I'm starting to feel that if there's less demand compared to count_distinct, it might not be worth adding specifically...
https://github.com/SeaQL/sea-query/blob/f778d36b7317a7851848115d7636099f2d177244/src/expr.rs#L1886-L1891
sorry for the delay, if count_distinct is what you need, let's just add that specifically!