9 lines
335 B
Python
9 lines
335 B
Python
|
|
from sqlmodel import Session, create_engine
|
||
|
|
from app.core.config import settings
|
||
|
|
|
||
|
|
connect_args = {"check_same_thread": False} # SQLite-specific argument for multithreading
|
||
|
|
engine = create_engine(settings.database_url, echo=True, connect_args=connect_args)
|
||
|
|
|
||
|
|
def get_session():
|
||
|
|
with Session(engine) as session:
|
||
|
|
yield session
|