Advertisement
Guest User

Untitled

a guest
Oct 13th, 2022
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | Source Code | 0 0
  1. async def get_asyncpg_session() -> AsyncIterator[AsyncSession]:
  2.     async with AsyncSession(
  3.         async_engine,
  4.         expire_on_commit=False,
  5.     ) as session:
  6.         async with session.begin():
  7.             yield session
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement