Implementing HasTable for n-uples of tuples of columns from the same table
#4870
Closed
LucaCappelletti94
started this conversation in
Ideas
Replies: 3 comments 2 replies
|
That sounds like a reasonable addition. We should use the existing |
0 replies
|
Ok - any comment on the desirability of having a |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Backend
PostgreSQL, MySQL, SQLite, Others
What do you want to add to diesel?
I’d like to enforce multi-column constraints using a custom
ForeignKeymarker trait. For that to work, tuples of columns needHasTableimpls — but the orphan rule prevents implementing them outside Diesel.Example desired behavior:
Would Diesel accept adding these macro-generated
HasTableimpls?Happy to submit a PR.
Implementation notes
A macro could generate these impls by splitting the first column from the rest:
Additional details
The aforementioned
ForeignKeymarker trait could reasonably be placed in diesel. Would that be desirable?Checklist
All reactions