feat: return parameters only for DB with default driver (#14803)

* WIP

* Fix sorting of DBs
This commit is contained in:
Beto Dealmeida
2021-05-25 14:46:54 -07:00
committed by GitHub
parent f1ea1d74a7
commit 8b1a117d24
10 changed files with 163 additions and 101 deletions

View File

@@ -1328,7 +1328,7 @@ class BasicParametersMixin:
individual parameters, instead of the full SQLAlchemy URI. This
mixin is for the most common pattern of URI:
drivername://user:password@host:port/dbname[?key=value&key=value...]
engine+driver://user:password@host:port/dbname[?key=value&key=value...]
"""
@@ -1336,11 +1336,11 @@ class BasicParametersMixin:
parameters_schema = BasicParametersSchema()
# recommended driver name for the DB engine spec
drivername = ""
default_driver = ""
# placeholder with the SQLAlchemy URI template
sqlalchemy_uri_placeholder = (
"drivername://user:password@host:port/dbname[?key=value&key=value...]"
"engine+driver://user:password@host:port/dbname[?key=value&key=value...]"
)
# query parameter to enable encryption in the database connection
@@ -1361,7 +1361,7 @@ class BasicParametersMixin:
return str(
URL(
cls.drivername,
f"{cls.engine}+{cls.default_driver}".rstrip("+"), # type: ignore
username=parameters.get("username"),
password=parameters.get("password"),
host=parameters["host"],