Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Database URL supports query value with equal sign
A querystring value should be allowed to include an equal sign `=`. This is necessary to support passing `options` for a PostgresSQL connection. ``` development: url: postgresql://localhost/railsdevapp_development?options=-cmysetting.debug=on ``` Before this PR, attempting to start the rails process with that configuration would result in an error: ``` > bundle exec rails console Traceback (most recent call last): 49: from bin/rails:4:in `<main>' 48: from bin/rails:4:in `require' ... 1: from /rails/activerecord/lib/active_record/database_configurations/connection_url_resolver.rb:58:in `query_hash' /rails/activerecord/lib/active_record/database_configurations/connection_url_resolver.rb:58:in `[]': invalid number of elements (3 for 1..2) (ArgumentError) ``` After this PR, rails can properly parse the configuration: ``` > bundle exec rails console Loading development environment (Rails 6.1.0.alpha) 2.6.5 :001 > ActiveRecord::Base.connection.select_all("show mysetting.debug").to_a (0.4ms) show mysetting.debug => [{"mysetting.debug"=>"on"}] ```
- Loading branch information