Describe the solution you'd like
GROUP BY, HAVING and aggregation functions (such as count, avg, max and so on) support in queries. It could be very useful for making queries like this:
# Select all users with votes and count votes for each user
select user.id, count(vote.id) as votes_count
from user
left join vote on user.id = vote.user
group by user.id
having votes_count > 0;
Before ormar I used to use peewee and I really like a way how it implemented there.
I think it could be easily implemented for queries returning raw values. But it could be a problem with dynamic assigning of Pydantic model fields.
Describe the solution you'd like
GROUP BY, HAVING and aggregation functions (such as count, avg, max and so on) support in queries. It could be very useful for making queries like this:
Before ormar I used to use peewee and I really like a way how it implemented there.
I think it could be easily implemented for queries returning raw values. But it could be a problem with dynamic assigning of Pydantic model fields.