IS IT POSSIBLE: to use a relation field in a where clause?
Anyone knows if it's possible to have a nested relation in a where clause?
7 Replies
It seems that there is no access to the nested relation:
This is the example from the docs:
Could it be that the api only provide one nested layer?
Image
To anyone wondering, apparently it's not possible atm.
I had a small workaround, where i fetch only the ids with regular select and joins of the elements that match the where condition.
Then fetch the actually data with relational queries using
inArray
to make sure i get the format i want. hope this helps.@Dan Kochetov any ideas ^^ looking for this too
It’s not possible using the new query builder. See here:
https://github.com/drizzle-team/drizzle-orm/issues/798
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 into the issue - showing interest in this feature
Meantime, what you can do is use the regular query builder like this:
https://discord.com/channels/1043890932593987624/1128787983538073621