Skip to content

Commit

Permalink
change mysql_database url creation
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Sep 24, 2024
1 parent c0d3ce6 commit 742c339
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 742c339

Please sign in to comment.