-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Upgrading to syn v2 #1713
Upgrading to syn v2 #1713
Conversation
|
@darkmmon can you give a hint/guess on what's not working ? |
I know that it should be some issue about the macro syntax being changed by syn 2 |
sea-orm-macros/src/derives/column.rs
Outdated
if let Ok(list) = attr.parse_args_with(Punctuated::<Meta, Comma>::parse_terminated) | ||
{ | ||
for meta in list.iter() { | ||
if let Meta::NameValue(nv) = meta { | ||
if let Some(name) = nv.path.get_ident() { | ||
if name == "column_name" { | ||
if let Lit::Str(litstr) = &nv.lit { | ||
column_name = litstr.value(); | ||
} | ||
} | ||
if name == "table_name" { | ||
if let Lit::Str(litstr) = &nv.lit { | ||
column_name = litstr.value(); | ||
} | ||
} | ||
} | ||
} | ||
attr.parse_nested_meta(|meta| { | ||
if meta.path.is_ident("column_name") || meta.path.is_ident("table_name") { | ||
column_name = meta.value()?.parse::<LitStr>()?.value(); | ||
} else { | ||
// Reads the value expression to advance the parse stream. | ||
// Some parameters, such as `primary_key`, do not have any value, | ||
// so ignoring an error occurred here. | ||
let _: Option<Expr> = meta.value().and_then(|v| v.parse()).ok(); |
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.
For some reason, we both #[sea_orm(column_name = "col_name")]
and #[sea_orm(table_name = "col_name")]
override the str
value of column iden.
We should drop the use of #[sea_orm(table_name = "col_name")]
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.
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.
Thank you for the effort
🎉 Released In 0.12.1 🎉Thank you everyone for the contribution! |
PR Info
New Features
Breaking Changes
#[sea_orm(table_name = "col_name")]
inDeriveColumn
Changes