config, db: support db_url setting to override the individual options
#2087
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.
Description
Specifying a
core.db_urlsetting overrides the othercore.db_*settings and just uses the provided URL directly.Resolves #2057, more or less, though the envvar name isn't exactly what was mentioned in that feature request.
Checklist
make qa(runsmake qualityandmake test)sqlite:URL, retrieved frombot.dbviasopel-ipython. Presumably if that works, it'll work with MySQL/PostgreSQL/whatever else.Notes
It should now be trivial to simply copy the value of the
DATABASE_URLenvironment variable on Heroku into theSOPEL_CORE_DB_URLvariable expected by Sopel, instead of splitting it into components.Adding support for the envvar name
DATABASE_URL, if it happens, can be done separately.