© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
NΛRCISO

Optional One-to-One Relation

Currently it's possible to define only a One-to-One relation (https://orm.drizzle.team/docs/rqb#one-to-one) but in the types, the value returned will never be undefined or null.
In my use case I would like to define a One-to-One relation that could be optional.
Is there a solution? Is this even possible?

(I also raised an issue on GitHub (https://github.com/drizzle-team/drizzle-orm/issues/1066) a month ago but I think it got lost there)
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

Disambiguate optional one-to-one relationship
Drizzle TeamDTDrizzle Team / help
15mo ago
How to declare optional one-to-one relationship
Drizzle TeamDTDrizzle Team / help
16mo ago
one-to-many relation - multiple relations
Drizzle TeamDTDrizzle Team / help
3y ago
TypeScript error when specifying `relationName` in a one-to-one relation
Drizzle TeamDTDrizzle Team / help
3y ago