Replies: 1 comment 1 reply
-
|
I think "Don't derive any of the other traits" is more aligned with Rust design for, for example, |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
The new
#[derive(QueryModel]attribute (as proposed in #4600) currently internally manages the equivalent of#[derive(Queryable)]and#[derive(Selectable)]as well. The main argument for this behavior is to have one derive that can be applied for loading data, instead of requiring the user to write down 3 or 4 derives. We could extend this behavior to also include#[derive(Identifiable)]if we detect aidcolumn or a#[diesel(primary_key(_))]attribute is present. This would add a trait that is conditionally present on top of that behavior which could be surprising.On the other hand this make using this derive a bit more restrictive as users cannot anymore mix and match manual and automatic impls as required anymore.
8 votes ·
Beta Was this translation helpful? Give feedback.
All reactions