Relations, three level nested where?
Given a
User, Role, RoleToUser
many-to-many relation:
Are we able to filter with where on the third level to, for example, find all users belonging to a role of the given name?
Currently it doesn't seem to work, although of course in this example I can start with Role instead to achieve the same thing....5 Replies
Currently, you can filter the tables on their own fields only. Filtering on deeply nested fields is not implemented - https://github.com/drizzle-team/drizzle-orm/issues/696
Curious if this example in the documentation may be wrong, or we re doing something wrong on our end?
https://orm.drizzle.team/docs/rqb#include-relations
Relational queries – DrizzleORM
Drizzle ORM | %s
Yes, AFAIK this is deprecated since last version.
no, that example looks correct
the only thing we deprecated is filtering by nested relations from the outer query
so on every relation level, you can filter by that relation's columns
Hmm, interesting
I have a similar issue as well.
https://discord.com/channels/1043890932593987624/1139100297898238062
The orderBy'a function parameters are type any and there's no where to filter as well.