> ## 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.

# sql_iterator

> sql_iterator — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql_iterator.rs#L1-L498)&#x20;

Iterating over the records an SQL query returns, a batch at a time.The query runs against a paging table of the iterator’s own, named by a random UUID, so batches come from one result set in one order, and the server-side tables the iteration creates are dropped by [`SqlIterator::close`](https://docs.kinetica.com/content/api/rust/sql_iterator/struct.SqlIterator#method.close).

```rust theme={null}
use gpudb_api::{Kinetica, KineticaOptions, SqlIterator};
use std::sync::Arc;

let kinetica = Arc::new(Kinetica::new(vec!["http://localhost:9191".to_string()], KineticaOptions::new()).await?);
let mut records = SqlIterator::new(kinetica, "SELECT * FROM my_table").await?;
while records.has_next() {
    println!("{:?}", records.next().await?);
}
records.close().await;
```

## Structs

[SqlIterator](https://docs.kinetica.com/content/api/rust/sql_iterator/struct.SqlIterator.md)Iterates over the records an SQL query returns.

## Enums

[SqlParameters](https://docs.kinetica.com/content/api/rust/sql_iterator/enum.SqlParameters.md)The query parameters of [`Kinetica::execute_with_parameters`](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/execute-with-parameters#method.execute_with_parameters) and [`Kinetica::query_with_parameters`](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/query-with-parameters#method.query_with_parameters), sent as the `query_parameters` SQL option.


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