-
-
Notifications
You must be signed in to change notification settings - Fork 154
Added whitelist flags for generate command #506
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
Conversation
…or whitelisting the tables, views, and enums while generate command.
…s', and '-allow-enums'.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #506 +/- ##
=======================================
Coverage 91.32% 91.32%
=======================================
Files 136 136
Lines 8307 8307
=======================================
Hits 7586 7586
Misses 545 545
Partials 176 176 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cmd/jet/main.go
Outdated
|
||
flag.StringVar(&allowTables, "allow-tables", "", `Comma-separated list of tables to allow. Takes precedence over --ignore-tables flag.`) | ||
flag.StringVar(&allowViews, "allow-views", "", `Comma-separated list of views to allow. Takes precedence over --ignore-views flag.`) | ||
flag.StringVar(&allowEnums, "allow-enums", "", `Comma-separated list of enums to allow. Takes precedence over --ignore-enums flag.`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about allow
word in the name. Maybe just -tables
, -views
and -enums
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if the user uses both options (-tables
and -ignore-tables
), it would be best to return an error rather than silently choose one option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@go-jet Done the changes.
cmd/jet/main.go
Outdated
|
||
flag.StringVar(&allowTables, "tables", "", `Comma-separated list of tables to allow.`) | ||
flag.StringVar(&allowViews, "views", "", `Comma-separated list of views to allow.`) | ||
flag.StringVar(&allowEnums, "enums", "", `Comma-separated list of enums to allow.`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma-separated list of tables to generate.
, ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@go-jet Updated the description as suggested.
cmd/jet/main.go
Outdated
|
||
allowTables string | ||
allowViews string | ||
allowEnums string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also drop allow from this variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@go-jet Done. Dropped 'allow' from the variables.
cmd/jet/main.go
Outdated
) | ||
|
||
type templateFilter struct { | ||
names []string | ||
allow bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allow
as well, feels slightly misleading. Inverting the logic should be more clear - ignore bool
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@go-jet Makes sense. Refactored the logic to use ignore bool
.
…rd from the vairbales.
Thanks. Looks good. 👍 |
Added whitelist flags for generate command. Related to issue.
Flags
-allow-tables
Comma-separated list of tables to allow. Takes precedence over --ignore-tables flag.
-allow-views
Comma-separated list of views to allow. Takes precedence over --ignore-views flag.
-allow-enums
Comma-separated list of enums to allow. Takes precedence over --ignore-enums flag.