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

feat(goctl):Add ignore-columns flag #2407

Merged
merged 6 commits into from Sep 19, 2022

Conversation

kesonan
Copy link
Collaborator

@kesonan kesonan commented Sep 17, 2022

Added --ignore-columns, -i flag to specify the columns that need to be ignored when inserting or updating rows, for example: you need to ignore the create_time and update_time columns, you can use --ignore-columns, -i flag for model generation command reference is as follows

# generated from sql file
$ goctl model mysql ddl --src $sql_file --dir $output -i 'create_time' -i 'update_time'
# or use comma splitter
# $ goctl model mysql ddl --src $sql_file --dir $output -i 'create_time,update_time'

# generated from dsn
$ goctl model mysql datasource --url $dsn --table $patterns --dir $output -i 'create_time' -i 'update_time'
# or use comma splitter
# $ goctl model mysql datasource --url $dsn --table $patterns --dir $output -i 'create_time,update_time'

@kevwan
Copy link
Contributor

kevwan commented Sep 18, 2022

Is it better to support -i 'create_time,update_time'?

@kesonan
Copy link
Collaborator Author

kesonan commented Sep 19, 2022

Is it better to support -i 'create_time,update_time'?

Done

@kevwan kevwan merged commit 2cde970 into zeromicro:master Sep 19, 2022
@kesonan kesonan deleted the mysql-ignore-columns branch October 29, 2022 14:11
@yogibaba
Copy link

yogibaba commented Nov 7, 2022

Execution on PostgreSQL, gives Error: unknown flag: --ignore-columns

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.

None yet

3 participants