first commit
This commit is contained in:
3
app/db/base.py
Normal file
3
app/db/base.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
__all__ = ["SQLModel"]
|
||||
10
app/db/session.py
Normal file
10
app/db/session.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from sqlmodel import create_engine, Session
|
||||
from app.core.config import settings
|
||||
|
||||
|
||||
engine = create_engine(settings.DATABASE_URL, echo=False)
|
||||
|
||||
|
||||
def get_session() -> Session:
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
Reference in New Issue
Block a user