-
-
Notifications
You must be signed in to change notification settings - Fork 659
Proc macro parsing with darling and test #1412
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
base: master
Are you sure you want to change the base?
Proc macro parsing with darling and test #1412
Conversation
0488ff3 to
9e59ebc
Compare
billy1624
left a comment
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.
Hey @Diwakar-Gupta, thanks for the work!!
- the test needs to be done in a different way
I think the test is on the right track! :)
- we need to change structure struct
DeriveModel
Yes, would be better if we replace DeriveModel with DeriveModelDarling. As DeriveModelDarling already have all the info of DeriveModel.
Btw... a small nitpick. Should we name the derive data struct without the Daring prefix? For example, naming DeriveModelDarling as DeriveModel.
- Code generation need's to be changed
I'm not sure what you mean here. Could you please clarify?
- if this is going in right direction or not.
Good POC! Was in the right direction!
Appreciated the help :)
|
Thanks for the feedback. I will look after replacing |
|
Wow, interesting. I have never used darling. Seems like it can make the code much cleaner! |
|
Yep, wanna get rid of the parsing mess ASAP loll |
4045cf6 to
ddacf80
Compare
|
Hey @Diwakar-Gupta, I think you leave a comment here yesterday night but it's now gone. Anything I could help? |
sea-orm-macros/src/derives/model.rs
Outdated
| #[darling(default)] | ||
| enum_name: Option<String>, | ||
| #[darling(skip)] | ||
| column_ident: Option<Ident>, |
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.
darling cant parse column_ident because it has out own logic so made it Option and then calculated it in constructor. Not sure if having a function get_column_ident will be better.
Having function will remove most of the calculation code in constructor but then we wont be able to use column_ident variable and have to call function( it has to be called twice ).
|
@billy1624 All this are also commented in code.
|
650f6bf to
c6757a0
Compare
ccee6f1 to
5000416
Compare
billy1624
left a comment
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.
Hey @Diwakar-Gupta, I saw your implementation then I decided to try it before leaving comments. My experiment result: #1560
Feel free to copy the useful bits to your PR. Hopefully we can combine the "good" into single PR.
|
Thanks @billy1624 I will study the reference you have given. |
5000416 to
f876927
Compare
177ad17 to
1118af2
Compare
|
hey @billy1624 i have used your pr #1560 and fixed the merge conflict. |
Still Working need feedback
PR Info
Fixes
Problem discussed at #394 (comment).
Related PR
#1560
Tasks
darlingFile Changed
sea-orm-macros/Cargo.tomladdeddarlingdependencysea-orm-macros/src/derives/model.rsmodified parser and added test