SAE-A2-TruthInquiry/truthinquiry/ext/database/db_url.py
2023-03-09 14:40:42 +01:00

13 lines
347 B
Python

import os
from sqlalchemy import engine as eg
def get_db_url():
return eg.URL.create(
"mariadb+pymysql",
username=os.getenv("DB_USER"),
password=os.getenv("DB_PASSWORD"),
host=os.getenv("DB_HOST"),
port=os.getenv("DB_PORT"),
database=os.getenv("DB_DBNAME")
)