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 upUse joinable! macro to join using non PK columns #938
Comments
This comment has been minimized.
|
In theory we could allow this, but it would be more true to the associations API for this to go through the crates table, since that is the primary key both foreign keys are referencing. So this is at least partially a duplicate of the issues for adding through associations, but I'm going to leave this open since this is specific to declaring possible joins. |
This comment has been minimized.
steverob
commented
Jun 8, 2017
|
@sgrif it makes sense to go for a through association for this. But, would it not be nice to let the developers choose the appropriate approach here and diesel giving them all options? :) |
This comment has been minimized.
|
This was fixed by 5cd4c0c |
sgrif
closed this
Dec 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PritiKumr commentedJun 7, 2017
Trying to use the
joinable!macro for this issue on crates.io - rust-lang/crates.io#740We're trying to join the following tables -
Note - removed few columns for clarity.
I want to join these two tables on just the
crate_idcolumn. But this is part of a composite key oncrate_downloads. So when we do -I get the error -
Appreciate some guidance here. :)