Skip to content

Commit

Permalink
fix: add password encoding for alembic connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
lchen-2101 committed Jan 5, 2024
1 parent 2162c37 commit 49f599f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db_revisions/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from urllib import parse
from dotenv import load_dotenv
from logging.config import fileConfig
from sqlalchemy import engine_from_config, pool
Expand Down Expand Up @@ -29,7 +30,7 @@
INST_DB_HOST = os.environ.get("INST_DB_HOST")
INST_DB_NAME = os.environ.get("INST_DB_NAME")
INST_DB_SCHEMA = os.environ.get("INST_DB_SCHEMA")
INST_CONN = f"postgresql://{INST_DB_USER}:{INST_DB_PWD}@{INST_DB_HOST}/{INST_DB_NAME}"
INST_CONN = f"postgresql://{INST_DB_USER}:{parse.quote(INST_DB_PWD, safe='')}@{INST_DB_HOST}/{INST_DB_NAME}"
config.set_main_option("sqlalchemy.url", INST_CONN)

# end specific SBL configuration
Expand Down

0 comments on commit 49f599f

Please sign in to comment.