apply aggregation support
meitham opened this issue · comments
Hi Oliver,
Are there any plans to add support for aggregations? I'm basically after simple support of cases such as
/api/odata/Orders?$apply=aggregate($count as OrderCount)
Ideally this translates as a sqlalchemy sa.select([sa.func.count(Orders).label('OrderCount')])
.
I am happy to help adding support for this feature, but it requires a change to the grammer and I will need guidenace on best way to implement.
Many thanks
Meitham
Hey @meitham,
There are currently no active plans to support $apply
.
But I think it's a really cool use case, and would love to have it in the future (just like $select
, see #1 ).
This is going to be a big change though, maybe even needing a seperate parser for each function. I'm not familiar enough with that part of the OData spec yet. Will have to look into it!
I think if we're going to go for such a big change, we might need to re-think the parser entirely. It's currently built with SLY, which seems to be retiring.
Kind of crazy there isn't a really widely used Django OData library yet. This one could definitely fill that void - love it so far. Support for $top $skip $select $orderby
at least would be huge. Hopefully can get some time to help out myself!