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

add --with-prelude option to sea-orm-cli #2322

Closed
wants to merge 1 commit into from

Conversation

hahouari
Copy link
Contributor

@hahouari hahouari commented Aug 7, 2024

I opened a discussion on this feature a month ago (link below), I suppose it didn't take notice, so I picked it up and implemented the feature myself on my free time, and I'm happy to contribute it back :).

PR Info

New Features

Added --with-prelude option to sea-orm-cli generate entity command, it accepts 3 values:

  • [1] all: the default value, cli tool behaves as it does right now (so no breaking changes), it will generates the prelude.rs file and add it to mod.rs (or lib.rs).
  • [2] none: it WILL NOT generates the prelude.rs file and it WILL NOT add it to mod.rs.
  • [3] all-allow-unused-imports: it generates the prelude.rs file and add it to mod.rs, BUT the following inner attribute #![allow(unused_imports)] is appended to prelude.rs heading, see below:

This is how it looks like with --with-prelude=all:

image

This is how it looks like with --with-prelude=all-allow-unused-imports:

image

@hahouari hahouari changed the title add prelude option to sea-orm-cli add --with-prelude option to sea-orm-cli Aug 7, 2024
Copy link

@Razzwan Razzwan left a comment

Choose a reason for hiding this comment

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

It seems awesome. Thank you for that PR. I hope, it will be merged soon

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.

Thank you

@tyt2y3
Copy link
Member

tyt2y3 commented Feb 19, 2025

sorry, I just realized a recent PR created a conflict

@hahouari
Copy link
Contributor Author

finally 👏. Thank you ♥️. Hope to see it merged soon

@tyt2y3
Copy link
Member

tyt2y3 commented Feb 22, 2025

I've merged manually 56ed258! there seems to be many conflicts that github don't recognize the commit.

@tyt2y3 tyt2y3 closed this Feb 22, 2025
Copy link

🎉 Released In 1.1.6 🎉

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.

3 participants