crappy
This commit is contained in:
		@@ -1,3 +1,5 @@
 | 
			
		||||
from typing import AsyncGenerator
 | 
			
		||||
 | 
			
		||||
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
 | 
			
		||||
from sqlalchemy.orm import sessionmaker
 | 
			
		||||
 | 
			
		||||
@@ -10,10 +12,10 @@ session_maker = sessionmaker(
 | 
			
		||||
    class_=AsyncSession,
 | 
			
		||||
    expire_on_commit=False,
 | 
			
		||||
    autocommit=False,
 | 
			
		||||
    autoflush=False
 | 
			
		||||
    autoflush=False,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async def get_session() -> AsyncSession:
 | 
			
		||||
async def get_session() -> AsyncGenerator[AsyncSession, None]:
 | 
			
		||||
    async with session_maker() as session:
 | 
			
		||||
        yield session
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user