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: Support deriving ActiveEnum without importing some types #1146

Merged

Conversation

siketyan
Copy link
Sponsor Contributor

@siketyan siketyan commented Oct 24, 2022

PR Info

  • Dependencies:
    • N/A
  • Dependents:
    • N/A

Adds

N/A

Fixes

  • Canonicalised usages of types with sea_orm:: prefix to enable derives without importing the types
    • Either importing sea_orm::sea_query or depending on sea_query crate is still needed due to types derived in sea_query_derive crate

Breaking Changes

N/A

Changes

N/A

/// # Usage
///
/// ```
/// use sea_orm::{sea_query, EnumIter, DeriveActiveEnum};
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

Now we do not need to import Iden, EnumIter nor ActiveEnum, but sea_query is still needed.

@siketyan
Copy link
Sponsor Contributor Author

Hi @billy1624 , thank you for triaging this pull request!
I think #1151 will NOT be resolved by this changes.

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

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

Hey @siketyan, thanks for helping!!

Hi @billy1624 , thank you for triaging this pull request! I think #1151 will NOT be resolved by this changes.

Yes, you're correct! I'm thing rewriting the derive macros, without using sea_query::Iden derive macros.

Would you mind if I merge your PR into another local branch so I can work on top of your work?

I'll create a PR to fix both issues and ask for your help to validate the fix did works. Thanks in advance!! :)

@siketyan
Copy link
Sponsor Contributor Author

@billy1624

Would you mind if I merge your PR into another local branch so I can work on top of your work?

Sure, of course!
So I leave it to you about sea_query stuff.

@billy1624 billy1624 changed the base branch from master to fix-enum-derive-imports October 26, 2022 06:22
@billy1624 billy1624 merged commit 9749d20 into SeaQL:fix-enum-derive-imports Oct 26, 2022
@siketyan siketyan deleted the fix-enum-derive-imports branch October 26, 2022 06:30
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.

2 participants