from sqlalchemy import select from db.models import Addon from db.session import UnitOfWork class AddonsRepository: def __init__(self, uow: UnitOfWork) -> None: self.session = uow.session async def get_all(self) -> list[Addon]: stmt = select(Addon) r = await self.session.execute(stmt) return list(r.scalars().all()) async def get_by_id(self, id: str) -> Addon | None: stmt = select(Addon).where(Addon.id == id) r = await self.session.execute(stmt) return r.scalar_one_or_none()