Naming decision on traits and derive macros #605
Replies: 1 comment 1 reply
-
First of all thank you. You raised lots of good points actually. I think the rationale is "no one name stands for two things". As for why macros starts with Derive. I am actually confused for why a symbol in Rust can stand for both a trait and a macro at the same time and there is no way to Similar cause for other things, usually because there were already a thing named But I agree that it seems inconsistent in general, and some naming changes will be welcomed where appropriate. |
Beta Was this translation helpful? Give feedback.
-
When reading the sea-orm api I got a bit surprised about the naming choices of some
Derive Macros
andTraits
.In general for rust it is common to name
Derive Macros
without including thederive
word. Because that information is already implicitly done by thederive()
part see:You may have already noticed, that
sea-orm
stands out with itsDeriveRelation
macro. So this looks somewhat inconsistent and confusing I think. Alsosea-orm
is not even consistent within itself with for exampleFromQueryResult
not having theDerive
part.The same goes for Traits, where some
sea-orm
traits end withTrait
likeConnectionTrait
while others do not likeStatementBuilder
. And also in general it is usually not common for traits in rust to have aTrait
suffix.So I would be interested, what the rationale behind those api decisions is, or if it just happend to be like this or if there are any plans to clean up the api if you think that would make sense.
Beta Was this translation helpful? Give feedback.
All reactions