def check_result(func):
    """Decorator that checks if the cursor has results from `execute`."""

    def decorator(self, *args, **kwargs):
        if self._results is None:  # pylint: disable=protected-access
            raise Exception("Called before `execute`")
        return func(self, *args, **kwargs)

    return decorator