mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: various issues
This commit is contained in:
parent
8c47e5ff4e
commit
838b2ee03a
5 changed files with 43 additions and 11 deletions
|
|
@ -5,7 +5,7 @@ from sqlmodel import SQLModel, Session, create_engine
|
|||
|
||||
learnhouse_config = get_learnhouse_config()
|
||||
engine = create_engine(
|
||||
learnhouse_config.database_config.sql_connection_string, echo=False # type: ignore
|
||||
learnhouse_config.database_config.sql_connection_string, echo=False, pool_pre_ping=True # type: ignore
|
||||
)
|
||||
SQLModel.metadata.create_all(engine)
|
||||
|
||||
|
|
@ -16,8 +16,6 @@ async def connect_to_db(app: FastAPI):
|
|||
SQLModel.metadata.create_all(engine)
|
||||
|
||||
|
||||
|
||||
|
||||
def get_db_session():
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue