aboutsummaryrefslogtreecommitdiff
path: root/uploader/db_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/db_utils.py')
-rw-r--r--uploader/db_utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/uploader/db_utils.py b/uploader/db_utils.py
index ef26398..357b3da 100644
--- a/uploader/db_utils.py
+++ b/uploader/db_utils.py
@@ -19,10 +19,9 @@ def parse_db_url(db_url) -> Tuple:
@contextlib.contextmanager
-def database_connection(db_url: Optional[str] = None) -> Iterator[mdb.Connection]:
+def database_connection(db_url: str) -> Iterator[mdb.Connection]:
"""function to create db connector"""
- host, user, passwd, db_name, db_port = parse_db_url(
- db_url or app.config["SQL_URI"])
+ host, user, passwd, db_name, db_port = parse_db_url(db_url)
connection = mdb.connect(
host, user, passwd, db_name, port=(db_port or 3306))
try: