-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
query_as!/query! inference returns nullable entries on join when a bound parameter is absent #1265
Comments
@jplatte I've subscribed to those other tickets, shall I close this? |
As-is I don't think this issue adds anything new, but it seems like your circumstances are a bit different so if you can provide some more information on your case (#1126 (comment)) that might help debug this issue.
|
|
Specifically we need the output of |
Oops, I misunderstood, here ya goes
|
@rtyler yeah our heuristics haven't really been tested on cross joins. However, it looks like you probably want an inner join with SELECT shares.name as share_name, schemas.* FROM shares INNER JOIN schemas on shares.id = share_id WHERE shares.name = 'jtyler' You usually want to select the most specific data first (in this case |
@abonander in my experience, the type of join doesn't matter. I'm getting the same issue with inner joins as well.
|
I've been debugging some joins recently and discovered that
query_as!
has different behavior when there are parameters bound or not.This example case is with PostgreSQL and I've modified to use
query!
just so I could see what records were returned. Both macros seem to have the same erroneous behavior.Outputs the following:
Something about binding a parameter seems to correct the behavior 😕
The text was updated successfully, but these errors were encountered: