Limitation in Drizzle? findMany does not work the same as an innerjoin, is it possible?
So I want to get all posts with supporters with a specific user_id.
Q1 gives me that but I'd like to do it with Q2 but Q2 gives me all posts instead of just the ones that the user_id is supporting.
UPDATE
I went this Q3 which works fine.
2 Replies
This is known, the RQB doesn't support filtering by nested relations
Your workaround works but you could do this in a single query
This will send the ideaIds as a subquery inside the RQB, in only one request
GitHub
Release 0.28.0 · drizzle-team/drizzle-orm
Breaking changes
Removed support for filtering by nested relations
Current example won't work in 0.28.0:
const usersWithPosts = await db.query.users.findMany({
where: (table, { sql }) => (...