What is Correct Syntax for Group By (if any)?


I have a rather straightforward problem with Vapor Fluent. Given three models — Group, Member, Role (Group to Member is one-to-many and Member to Role is many-to-many), I need to find all members for a given list of groups where the role matches a certain value, grouped by the group ID.

I am struggling to figure out if there is a way to use SQL Group By or if I have to manually transform the result. Can anyone help?


Fluent doesn't support GROUP BY at the moment so the easiest thing to do is to drop down to SQLKit or manually transform the result (you can do the rest with joins)

Got it. Thanks.