-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE]: Optional One-to-One Relation #1066
Comments
+1. I think the types should at least be |
Any idea why it's not already nullable? |
+1 |
Any update on this? |
Hey, do we have an update for this? |
Yes, this one is a must have! |
I think you can accomplish with this comment https://www.answeroverflow.com/m/1126473676804599881 i.e. only put the export const shopifyIntegrationRelations = relations(
shopifyIntegrations,
({ one }) => ({
organization: one(organizations, {
fields: [shopifyIntegrations.organizationId],
references: [organizations.id],
}),
}),
);
export const organizationRelations = relations(
organizations,
({ one, many }) => ({
shopifyIntegration: one(shopifyIntegrations),
}),
); |
Describe what you want
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?
The text was updated successfully, but these errors were encountered: