diff --git a/backend/common/core/db.py b/backend/common/core/db.py new file mode 100644 index 0000000..37eff29 --- /dev/null +++ b/backend/common/core/db.py @@ -0,0 +1,14 @@ +from sqlmodel import Session, create_engine, SQLModel + + +from common.core.config import settings + + +engine = create_engine(str(settings.SQLALCHEMY_DATABASE_URI)) + +def get_session(): + with Session(engine) as session: + yield session + +def init_db(): + SQLModel.metadata.create_all(engine)