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 upSupport composite primary keys #42
Comments
sgrif
added
the
enhancement
label
Dec 20, 2015
sgrif
added this to the
0.6 milestone
Feb 5, 2016
This comment has been minimized.
|
This will likely be much easier once we implement the |
sgrif
modified the milestones:
1.0,
0.7
Jun 27, 2016
sgrif
modified the milestones:
0.8,
1.0
Aug 11, 2016
added a commit
that referenced
this issue
Aug 25, 2016
added a commit
that referenced
this issue
Dec 8, 2016
sgrif
referenced this issue
Dec 8, 2016
Merged
Allow `#[derive(Identifiable)]` to work with composite primary keys #533
added a commit
that referenced
this issue
Dec 8, 2016
added a commit
that referenced
this issue
Dec 8, 2016
sgrif
closed this
in
#533
Dec 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedDec 2, 2015
I believe this should be straightforward. There's a couple of things to consider
Edit: The thoughts in this comment are super outdated, and likely no longer relevant.
Table::PrimaryKeyhas the constraintColumn<Table=Self>. Unsure if we want to relax that toSelectableExpression, or if we want to introduce theColumnstrait. We could even implementColumnfor tuples now if we really want to, as there's no longer any automatically added behaviors.conn.find(&posts_tags, &(1, 1))would be more likely to generateSELECT * FROM posts_tags WHERE (post_id, tag_id) = $1, instead ofSELECT * FROM posts_tags WHERE post_id = $1 AND tag_id = $2. Might be fine for an initial implementation, but we do eventually need to solve this to support other databases.