8000 [cli] generate entity programmatically by billy1624 · Pull Request #1054 · SeaQL/sea-orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[cli] generate entity programmatically #1054

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

Closed
wants to merge 1 commit into from

Conversation

billy1624
Copy link
Member
@billy1624 billy1624 commented Sep 21, 2022

PR Info

Adds

  • Refactor sea-orm-cli to allow generate entity programmatically. The new API with an entry point of GenerateEntity::new(database_url) follow by a bunch of set methods to customize the generation behaviour.

@LeoBorai
Copy link
Contributor

Awesome @billy1624! Thanks a lot! Will be checking closely later today.

@JonasCir

This comment was marked as outdated.

@JonasCir
Copy link

On second thought, it is perfectly fine as we just start the CLI programmatically.

8000
Copy link
Contributor
@LeoBorai LeoBorai left a comment

Choose a reason for hiding this comment

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

Looking good so far @billy1624!

@JonasCir
Copy link
JonasCir commented Oct 7, 2022

Hey just one quick note:
run_migrate_command takes the sub-command as input while this PR uses a builder style pattern. I do not have a strong preference for either style, however, it might be a good idea to stick to a consistent pattern in the re-exported methods.


Edit: I noticed the run_generate_command also takes Option<GenerateSubcommands>.

The advantage of builder style is that setting defaults is possible, if I'm not mistaken.

@billy1624 billy1624 closed this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants
0