import sqlmodel
from sqlalchemy.future import Engine
from . import models
def get_engine(host: str, user: str, passwd: str, db: str) -> Engine:
engine = sqlmodel.create_engine(
f"mariadb+mariadbconnector://{user}:{passwd}@{host}/{db}"
)
return engine
def prepare(engine: Engine) -> None:
sqlmodel.SQLModel.metadata.create_all(
engine,
# [models.Account, models.MasterPass]