Skip to content

Commit

Permalink
Merge pull request #4 from mlibrary/fix-sqlalchemy-connection-url
Browse files Browse the repository at this point in the history
change mysql_database url creation
  • Loading branch information
niquerio authored Sep 24, 2024
2 parents c0d3ce6 + 742c339 commit 2cb8c17
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion aim/services.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from types import SimpleNamespace
import os
import sqlalchemy as sa

S = SimpleNamespace()
S.mysql_database = f'mysql+mysqldb://{os.environ["MARIADB_USER"]}:{os.environ["MARIADB_PASSWORD"]}@{os.environ["DATABASE_HOST"]}/{os.environ["MARIADB_DATABASE"]}'
S.mysql_database = sa.engine.URL.create(
drivername="mysql+mysqldb",
username=os.environ["MARIADB_USER"],
password=os.environ["MARIADB_PASSWORD"],
host=os.environ["DATABASE_HOST"],
database=os.environ["MARIADB_DATABASE"],
)
S.test_database = "sqlite:///:memory:"
S.ci_on = os.getenv("CI")

0 comments on commit 2cb8c17

Please sign in to comment.