© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•14mo ago•
8 replies
brynthrax

Nested relation filtering

We have a
user table (id, name, role…)
user table (id, name, role…)
and
section table (id, name…)
section table (id, name…)
, bridged by a
user_section table (userId, sectionId)
user_section table (userId, sectionId)
. Hence, a many-to-many relationship.

How can I accomplish in drizzle wherein I query for a section, including users (and its fields) under it, but only
users
users
with the
role “Student”
role “Student”
? Right now, I can only filter through
userId
userId
and
sectionId
sectionId
in the relational query API (see screenshot).
Pasted_Graphic.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

nested relation
Drizzle TeamDTDrizzle Team / help
2y ago
nested relation queries
Drizzle TeamDTDrizzle Team / help
3y ago
Filtering against a relation
Drizzle TeamDTDrizzle Team / help
3y ago
Query based on nested relation
Drizzle TeamDTDrizzle Team / help
2y ago