Make query iterable