Proposal: ForeignKey marker trait for Diesel schemas
#4875
LucaCappelletti94
started this conversation in
Ideas
Replies: 1 comment
-
|
I think that after a first draft of the trait is fully defined, several helper methods could be added on top of it, analogously to what is currently possible with the |
Beta Was this translation helpful? Give feedback.
0 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 propose a new marker trait for foreign keys in Diesel, providing compile-time type safety based on the SQL type of the columns.
In my code base, I use these markers to define higher-level semantics and control which getter/setter methods are allowed based on foreign key relationships.
Implementation notes
Additional details
INT→BIGINTreferences fail at compile time, while it is fine in many DBs.Checklist
Beta Was this translation helpful? Give feedback.
All reactions