Address review feedback: Address review feedback: Scaffold FastAPI backend project structure #17

Merged
reviewer-bot merged 27 commits from agent/684f458e47fc into main 2026-08-18 00:16:07 +00:00
Showing only changes of commit 1f85ecc812 - Show all commits
+6 -2
View File
@@ -28,11 +28,15 @@ class Base(DeclarativeBase):
async def get_db() -> AsyncSession:
"""Dependency that yields an async database session."""
"""Dependency that yields an async database session.
Handlers are responsible for committing or rolling back their own
transactions. This avoids the double-commit problem where the
session is committed both here and in the handler.
"""
async with async_session_factory() as session:
try:
yield session
await session.commit()
except Exception:
await session.rollback()
raise