add ruff format, ruff check, time_picker, project structure and imports reorganized

This commit is contained in:
Alexander Kalinovsky
2025-01-21 23:50:19 +01:00
parent ced47ac993
commit 9dd0708a5b
58 changed files with 3690 additions and 2583 deletions

View File

@@ -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