Support hash table options with --table-hash-options#331
Merged
winebarrel merged 1 commit intoridgepole:0.9from Jan 2, 2021
Merged
Support hash table options with --table-hash-options#331winebarrel merged 1 commit intoridgepole:0.9from
--table-hash-options#331winebarrel merged 1 commit intoridgepole:0.9from
Conversation
2af2e75 to
ca29737
Compare
--table-hash-options--table-hash-options
ca29737 to
1f8eb0f
Compare
--table-hash-options--table-hash-options
Merged
3530e8a to
abe7159
Compare
winebarrel
reviewed
Jan 2, 2021
bin/ridgepole
Outdated
| opt.on('', '--dry-run') { options[:dry_run] = true } | ||
| opt.on('', '--table-options OPTIONS') { |v| options[:table_options] = v } | ||
| opt.on('', '--table-hash-options JSON') do |v| | ||
| json = JSON.parse(v, symbolize_names: true) |
Member
There was a problem hiding this comment.
How about using YAML?
- Compatible with JSON
- Same as the existing option (e.g.
--config '{adapter: mysql2...}') - Can be written simply
related: ridgepole#323 (comment) Added option `--table-hash-options` to set default hash table options. ``` ridgepole --table-hash-options='{ id: { unsigned: true }, charset: "utf8mb4" }' ```
abe7159 to
76793e0
Compare
winebarrel
reviewed
Jan 2, 2021
Comment on lines
+90
to
+91
| # NOTE: Ruby2.4 doesn't support `symbolize_names: true` | ||
| hash = YAML.safe_load(v).deep_symbolize_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related: #323 (comment)
Added option
--table-hash-optionsto set default hash table options.