async def remove(
        self, db: AsyncSession, *, id: UUID, uow: UnitOfWork = None
    ) -> Optional[ModelType]:
        """Delete an object.

        Args:
        ----
            db (AsyncSession): The database session.
            id (UUID): The UUID of the object to delete.
            uow (UnitOfWork, optional): Unit of work for transaction control.

        Returns:
        -------
            Optional[ModelType]: The deleted object.

        """
        result = await db.execute(select(self.model).where(self.model.id == id))
        db_obj = result.unique().scalar_one_or_none()
        if db_obj is None:
            return None

        await db.delete(db_obj)

        if uow is None:
            await db.commit()

        return db_obj
Delete an object.

        Args:
        ----
            db (AsyncSession): The database session.
            id (UUID): The UUID of the object to delete.
            uow (UnitOfWork, optional): Unit of work for transaction control.

        Returns:
        -------
            Optional[ModelType]: The deleted object.

        
backend/airweave/crud/_base_system.py