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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hahouari
Copy link

@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
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.

1 participant