-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
find_also_related()
with non null relation, or using inner join, should not return Option
#1203
Comments
Welcome. I agree we should have an equivalent for inner joins. We can do:
PR is welcomed |
Hey, I'm working on it. |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
I have a foreign key that looks like:
The SQL constraints should mean that every session is associated with a user.
I would like to select sessions with their associated user, so that I get
(Session, User)
, but when I usefind_also_related()
it returns(Session, Option<User>)
.Then I looked at the code behind
find_also_related
and can see it is using a left join:What I was really looking to do is an inner join:
But the problem is that the
select_also
still returns anOption
even after doing an inner_join, surely the User can never be None?It would be great if there could be an API to make this a bit friendlier?
Additional Information
See also:
The text was updated successfully, but these errors were encountered: