© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
39 replies
smoke

Relations module - or condition

Hi there!

I have a teams table, an users table, and a team_members table that connects these two. A team also has an ownerId column.

Currently I have a query that fetches all the teams of an userId whether they are connected through the ownerId column or the join table.

I was wondering if this is possible using the new relations module? Since this is a many-to-many, but also an one-to-many, with an 'or' condition.
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

How to apply "where OR condition" and "lt or gt condition" on timestamp fields
Drizzle TeamDTDrizzle Team / help
15mo ago
With condition
Drizzle TeamDTDrizzle Team / help
3y ago
Disambiguating relations
Drizzle TeamDTDrizzle Team / help
12mo ago
Extending Relations
Drizzle TeamDTDrizzle Team / help
2y ago