add ruff format, ruff check, time_picker, project structure and imports reorganized
This commit is contained in:
@@ -4,15 +4,16 @@ from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from ..config import config
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger('sqlalchemy.engine')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
# import logging
|
||||
# logger = logging.getLogger('sqlalchemy.engine')
|
||||
# logger.setLevel(logging.DEBUG)
|
||||
|
||||
async_engine = create_async_engine(config.DATABASE_URI)
|
||||
async_session = sessionmaker[AsyncSession](
|
||||
async_engine, class_=AsyncSession, expire_on_commit=False
|
||||
)
|
||||
async_engine, class_=AsyncSession, expire_on_commit=False
|
||||
)
|
||||
|
||||
async def get_db() -> AsyncSession: # type: ignore
|
||||
|
||||
async def get_db() -> AsyncSession: # type: ignore
|
||||
async with async_session() as session:
|
||||
yield session
|
||||
yield session
|
||||
|
||||
Reference in New Issue
Block a user