async def remove(
        self,
        db: AsyncSession,
        *,
        id: UUID,
        current_user: schemas.User,
        uow: Optional[UnitOfWork] = None,
    ) -> schemas.Sync:
        """Remove a sync.

        Override the base method to ensure the returned sync is enriched with connections.

        Args:
            db (AsyncSession): The database session
            id (UUID): The ID of the sync
            current_user (schemas.User): The current user
            uow (UnitOfWork, optional): The unit of work

        Returns:
            schemas.Sync: The model validated schema of the removed sync
        """
        # First, fetch the sync with its connections before deletion
        enriched_sync = await self.get(db, id=id, current_user=current_user)

        # Delete the sync_connection records first to avoid foreign key constraint violations
        delete_stmt = delete(SyncConnection).where(SyncConnection.sync_id == id)
        await db.execute(delete_stmt)

        # Flush the changes to make sure they're applied before deleting the sync
        await db.flush()

        # Then remove using the base method
        removed_sync = await super().remove(db, id=id, current_user=current_user, uow=uow)

        # The connections are already deleted, so we need to create the response
        # from the previously enriched sync
        sync_dict = {**removed_sync.__dict__}
        if "_sa_instance_state" in sync_dict:
            sync_dict.pop("_sa_instance_state")

        # Add the connection IDs from the pre-fetched enriched sync
        sync_dict["source_connection_id"] = enriched_sync.source_connection_id
        sync_dict["destination_connection_ids"] = enriched_sync.destination_connection_ids
        sync_dict["embedding_model_connection_id"] = enriched_sync.embedding_model_connection_id

        # Return a properly model-validated instance
        return schemas.Sync.model_validate(sync_dict)
Remove a sync.

        Override the base method to ensure the returned sync is enriched with connections.

        Args:
            db (AsyncSession): The database session
            id (UUID): The ID of the sync
            current_user (schemas.User): The current user
            uow (UnitOfWork, optional): The unit of work

        Returns:
            schemas.Sync: The model validated schema of the removed sync
        
backend/airweave/crud/crud_sync.py