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
Mendy
MendyOP2y ago
It seems that there is no access to the nested relation:
Mendy
MendyOP2y ago
This is the example from the docs:
Mendy
MendyOP2y ago
Could it be that the api only provide one nested layer? Image To anyone wondering, apparently it's not possible atm.
Aimen
Aimen2y ago
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.
aulneau
aulneau17mo ago
@Dan Kochetov any ideas ^^ looking for this too
Mendy
MendyOP17mo ago
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?
Mendy
MendyOP17mo ago
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
Want results from more Discord servers?
Add your server