> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# gpudbsqliterator

> gpudbsqliterator — Kinetica Python API

# Class GPUdbSqlIterator

&#x20;class gpudb.GPUdbSqlIterator(db: [GPUdb](https://docs.kinetica.com/content/api/python/source/gpudb.md#gpudb.GPUdb), sql: str, batch\_size: int = 5000, sql\_params: list | None = None, sql\_opts: dict | None = None)[\[source\]](https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb_sql_iterator.py#L19)

Iterates over the records of a given query.Example

```
result_list = []
with GPUdbSqlIterator(db, sql,
                      batch_size=batch_size,
                      sql_opts=sql_opts) as sql_iter:

    for rec in tqdm(iterable=sql_iter,
                    total=sql_iter.total_count,
                    desc='Fetching Records',
                    disable=(not show_progress),
                    ncols=cls.TQDM_NCOLS):
        result_list.append(rec)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.