Skip to content
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

Relations improvements (fixes #1066 and #3763) #4104

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fnimick
Copy link

@fnimick fnimick commented Feb 12, 2025

Fixes #1066
Fixes #3763

Names were previously `TIsNullable` and `isNullable` respectively, but
this was actually being set to true if the relation was *not* nullable.
Changed to `TIsNonNullable` and `isNonNullable` to match.
This allows for disambiguation of one-to-one relations where the other
half of the one-to-one has fields and references defined.
Includes integration tests to test named relation operations.

Fixes drizzle-team#3763
@fnimick
Copy link
Author

fnimick commented Feb 12, 2025

Two notes:

  • the docs for relations need to be updated
  • for some queries that I expect to reject, I need to wrap them in another expect(async () => { await queryPromise; })... lambda, rather than expect(queryPromise).rejects..... This is unrelated to my changes, but I don't know why this occurs.

@mdotme
Copy link

mdotme commented Feb 23, 2025

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants