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

Adding config option for flag in sea-orm-cli generate entity #1467

Closed
wants to merge 2 commits into from

Conversation

aadi58002
Copy link
Contributor

@aadi58002 aadi58002 commented Feb 9, 2023

PR Info

New Features

  • Adds a option to have a config file for the generate entity sea-orm-cli command.

@aadi58002 aadi58002 changed the title Config Adding config option for flag in sea-orm-cli generate entity Feb 9, 2023
@aadi58002
Copy link
Contributor Author

@tyt2y3 or @billy1624
can you review the PR and give feedback for 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 @aadi58002, thanks for the initiative and for contributing!!

I agree that we should split the fields in GenerateSubcommands::Entity( ... ) into a separate struct (GenerateSubCommandsEntity) as you just did.

However, can we keep the field type in GenerateSubCommandsEntity untouched? I imagine the user will always provide the database_url and database_schema. The config file (if provided) will override all other options and flags. i.e. sea-orm-cli entity generate -url mysql://sea:sea@localhost/bakery -schema bakery -config my_config.json

@aadi58002
Copy link
Contributor Author

aadi58002 commented Mar 8, 2023

Hey @aadi58002, thanks for the initiative and for contributing!!

I agree that we should split the fields in GenerateSubcommands::Entity( ... ) into a separate struct (GenerateSubCommandsEntity) as you just did.

However, can we keep the field type in GenerateSubCommandsEntity untouched? I imagine the user will always provide the database_url and database_schema. The config file (if provided) will override all other options and flags. i.e. sea-orm-cli entity generate -url mysql://sea:sea@localhost/bakery -schema bakery -config my_config.json

We can skip the url and schema field during de serialized i think which does make it so that database_url and database_scheme will not be de serialized from the config and will need to be provided from the cli.
e51d66d

@aadi58002
Copy link
Contributor Author

@billy1624 can you review this PR?

@aadi58002
Copy link
Contributor Author

@billy1624 or @tyt2y3 Can you review this PR and give feedback?

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
Development

Successfully merging this pull request may close these issues.

Config file of sea-orm-cli generate entity command
2 participants