Skip to content

Commit ea0e586

Browse files
authored
Create deps.py
1 parent b49944c commit ea0e586

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/api/deps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from app.db.session import get_async_session
2+
from typing import AsyncGenerator
3+
from sqlalchemy.ext.asyncio import AsyncSession
4+
5+
async def get_session() -> AsyncGenerator[AsyncSession, None]:
6+
async for s in get_async_session():
7+
yield s

0 commit comments

Comments
 (0)