Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upUnable to `inner_join` to multiple tables (A->B and A->C, not A->B->C) #1297
Comments
This comment has been minimized.
|
Try to add |
weiznich
added
documentation
question
labels
Nov 7, 2017
This comment has been minimized.
trombonehero
commented
Nov 7, 2017
|
That does seem to fix it... thank you! Now I suppose the question is: what documentation fixes might help others avoid this particular pothole in the future? |
This comment has been minimized.
We've been trying to document it a bit more in the relevant methods for the upcoming release. It appears in the docs for Additionally on master, both |
sgrif
closed this
Nov 7, 2017
This comment has been minimized.
trombonehero
commented
Nov 8, 2017
|
Ok, so it sounds like v0.17.0 will “just work”? If so, that’s great! Thanks. |
This comment has been minimized.
|
0.99 but yes |
trombonehero commentedNov 7, 2017
•
edited
Setup
Versions
1.23.0-nightly (8b22e70b2 2017-10-31)0.16.0postgresFeature Flags
[ "postgres" ]Problem Description
What are you trying to accomplish?
I have a reduced test case that involves three types of DB-backed objects:
Room,UserandBooking. ABookingobject represents aUserhaving reserved aRoom(e.g., for a meeting):When I run
diesel print-schemaI see:I'm also able to use a single
inner_joinbetweenBookingand eitherRoomorUser:Next, I want to be able to retrieve a
Vec<(Booking, Room, User)>from the database by joining bothbookings->roomsandbookings->usersin the same query.What is the expected output?
When I try to compile:
I would expect Diesel to generate a query like:
(i.e., joining
bookings->roomsandbookings->users)What is the actual output?
So, Diesel seems to be trying to join
bookings->roomsandrooms->users. I would've expected this if I were trying to compile:but in my use case, I'm trying to join both
roomsanduserswithbookingsindividually.Steps to reproduce
DATABASE_URLcargo buildChecklist