You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you check that GROUP_CONCAT supports this syntax, by showing some example queries?
I might get around to adding this, but if you can try to open a PR that's a much better way of adding this feature. I don't use django-mysql very often these days, as most clients I work with use PostgreSQL.
I just created a PR with a fix, based on Django Count.
Instead of creating the SQL manually, the Django Aggregate compiler is used instead. But that leaves out support for ORDER BY and SEPARATOR. Probably, this can be added by updating the template expression. But I did not do this for lack of time, understanding and filter was more important for me than the other two.
Should someone figure how to do this, then the manual query creation code could probably go entirely. At the moment, it continues to be used when there is no filter expression.
Instead of creating the SQL manually, the Django Aggregate compiler is used instead. But that leaves out support for ORDER BY and SEPARATOR. Probably, this can be added by updating the template expression. But I did not do this for lack of time, understanding and filter was more important for me than the other two.
I've commented on the PR that I was confused by this. Now I see your comment that this was due to lack of time, I won't merge this in its current state. I'd like the filter pathway to be part of the existing compilation code.
Activity
[-]group_concat missing filter parameter[/-][+]GroupConcat missing `filter` parameter[/+]adamchainz commentedon Sep 13, 2022
Can you check that
GROUP_CONCATsupports this syntax, by showing some example queries?I might get around to adding this, but if you can try to open a PR that's a much better way of adding this feature. I don't use django-mysql very often these days, as most clients I work with use PostgreSQL.
caramdache commentedon Sep 14, 2022
I just created a PR with a fix, based on Django
Count.Instead of creating the SQL manually, the Django Aggregate compiler is used instead. But that leaves out support for
ORDER BYandSEPARATOR. Probably, this can be added by updating thetemplateexpression. But I did not do this for lack of time, understanding and filter was more important for me than the other two.Should someone figure how to do this, then the manual query creation code could probably go entirely. At the moment, it continues to be used when there is no filter expression.
adamchainz commentedon Sep 14, 2022
I've commented on the PR that I was confused by this. Now I see your comment that this was due to lack of time, I won't merge this in its current state. I'd like the filter pathway to be part of the existing compilation code.
caramdache commentedon Sep 14, 2022
I've added support for ORDER BY and SEPARATOR earlier today.