mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-04-15 22:26:25 +02:00
fix: force auto-begin in create_db_dependency so lock_tables always uses savepoints (#176)
This commit is contained in:
@@ -56,6 +56,7 @@ def create_db_dependency(
|
||||
|
||||
async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
||||
async with session_maker() as session:
|
||||
await session.connection()
|
||||
yield session
|
||||
if session.in_transaction():
|
||||
await session.commit()
|
||||
|
||||
Reference in New Issue
Block a user