Print warning when unknown options are passed to Trilogy#initialize#155
Draft
bensheldon wants to merge 5 commits intomainfrom
Draft
Print warning when unknown options are passed to Trilogy#initialize#155bensheldon wants to merge 5 commits intomainfrom
bensheldon wants to merge 5 commits intomainfrom
Conversation
contrib/ruby/lib/trilogy.rb
Outdated
| end | ||
| $stderr.puts "WARNING: Unknown Trilogy options: #{original_options.keys.join(", ")}" unless original_options.empty? | ||
| invalid_keys = options.keys - VALID_OPTIONS | ||
| $stderr.puts "WARNING: Unknown Trilogy options: #{invalid_keys.keys.join(", ")}" unless original_options.empty? |
Collaborator
There was a problem hiding this comment.
I think Rails might pass through the whole db config, which includes keys that wouldn't be valid here. We should check that before merging this.
bensheldon
commented
Jan 30, 2024
|
|
||
| class Trilogy | ||
| VALID_OPTIONS = %i[ | ||
| host port path database username password encoding |
Contributor
Author
There was a problem hiding this comment.
What is the distinction between socket and path options?
I see this:
trilogy/contrib/ruby/script/benchmark
Lines 15 to 16 in 362ee58
..but also this:
trilogy/contrib/ruby/test/test_helper.rb
Line 61 in 362ee58
Collaborator
There was a problem hiding this comment.
I don't think path is a valid option for either trilogy or mysql2. Maybe it used to be called path?
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.
Alternative to #151.
I'm not confident I have caught all of the possible configuration options.