Skip to content
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

fix: fully qualify types in DeriveValueType macro #2054

Merged
merged 1 commit into from Jan 14, 2024

Conversation

bobogei81123
Copy link
Contributor

DeriveValueType proc macro relies on several sea-orm types to be imported. This is partially fixed in #1855 by fully qualifying sea_orm::QueryResult, but others like sea_orm::Value is still not being qualified. Also, if use defined a type alias on std::result::Result, it can cause the proc macro to generate code that won't compile.

  • Fully qualify sea_orm::Value, std::string::String, and std::result::Result in DeriveValueType proc macro.
  • Add some simple integration tests for this.
  • Add doc and doc test in sea_orm_macro::derive_value_type.

PR Info

Bug Fixes

  • Fix bugs that DeriveValueType proc macro relies on several sea-orm types to be imported.

`DeriveValueType` proc macro relies on several sea-orm types to be
imported. This is partially fixed in SeaQL#1855 by fully qualifying
`sea_orm::QueryResult`, but others like `sea_orm::Value` is still not
being qualified. Also, if use defined a type alias on
`std::result::Result`, it can cause the proc macro to generate code that
won't compile.

- Fully qualify `sea_orm::Value`, `std::string::String`, and
  `std::result::Result` in `DeriveValueType` proc macro.
- Add some simple integration tests for this.
- Add doc and doc test in `sea_orm_macro::derive_value_type`.
Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy new year and thank you. Will merge after test suite passing. I have fixed clippy already, so no worries.

@tyt2y3 tyt2y3 merged commit 13d383e into SeaQL:master Jan 14, 2024
30 of 31 checks passed
Copy link

🎉 Released In 0.12.11 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants