-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement DeriveIden in sea-orm only #1740
Conversation
…shing when sea-query is not used
tests/derive_iden_tests.rs
Outdated
|
||
assert_eq!(Book::Id.to_string(), "id"); | ||
assert_eq!(Book::Title.to_string(), "turtle"); | ||
assert_eq!(Book::Text.to_string(), "te_xt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be...?
assert_eq!(Book::Text.to_string(), "te_xt"); | |
assert_eq!(Book::Text.to_string(), "TeXt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Iden in SeaQuery would make the name to be in snake case, no matter if it is from rename or the original name itself?
Having different behaviour from SeaQuery and SeaORM seems weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wait
maybe I was misreading the SeaQuery codes...
Seems like it doesn't change it after I re-read the code in SeaQuery.
Will change it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct me if I'm wrong. The original behaviour of sea_query::Iden
should be...
#[derive(Iden)]
#[iden = "_glyphAbcD"]
struct Glyph;
assert_eq!(Glyph.to_string(), "_glyphAbcD");
I want to make sea-query-derive an optional dependency. I will do it in another PR |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hey @plasticbox, as a temporary workaround, please import the use sea_orm::sea_query::{self}; |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@plasticbox I believe the build error you saw has been resolved now. If not please open a new thread with details of the error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is lovely.
References: SeaQL/sea-orm#1740 References: SeaQL/sea-orm#1755 Signed-off-by: Fletcher Nichol <[email protected]>
References: SeaQL/sea-orm#1740 References: SeaQL/sea-orm#1755 Signed-off-by: Fletcher Nichol <[email protected]>
References: SeaQL/sea-orm#1740 References: SeaQL/sea-orm#1755 Signed-off-by: Fletcher Nichol <[email protected]>
References: SeaQL/sea-orm#1740 References: SeaQL/sea-orm#1755 Signed-off-by: Fletcher Nichol <[email protected]>
References: SeaQL/sea-orm#1740 References: SeaQL/sea-orm#1755 Signed-off-by: Fletcher Nichol <[email protected]>
PR Info
derive(Iden)
#1473New Features
Bug Fixes
Breaking Changes
Changes