How to implement a where clause on a joined table with the new relation builder?
This was my original query, the big problem is that it returns as many rows as there are messages instead of one entry with multiple messages. As you can see, I have a where clause where the entry is filtered with it's id, and a organization id that is part of another joined table named channel.
3 Replies
Now I created almost an indentical output with the new builder. But now the problem is that I dont know how to filter on a joined table. in this example on "ticket.channel.organizationId". That part is missing here. How can I implement the filter?
I didn’t read your entire example but it seems you’re interested in this feature which is not implemented.
GitHub
[QUESTION] Use a relation field in a where clause · Issue #798 · dr...
Is it possible to use a relation field in a where clause? It seems that there is no access to the nested relation: This is the example from the docs: Dose drizzle only provide one nested layer?
Feel free to drop a comment in there - showing interest in this feature