You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`row_iterator_sync` is the third iterator which wraps `page_iterator_sync` and allows user to iterate over rows rather than pages.
3750
+
It is similar to native C++ iterators. So it can be used with `algorithm` header.
3751
+
It supports `operator*()`, `operator->()`, `operator++()` operators. Post increment operator is marked as `delete`.
3752
+
`timeout` can be set, it is used when fetching new page. It throws `exception::no_such_element` exception if the fetch operation is timed out.
3753
+
`row_iterator_sync` is copyable but it is there only for convenience. Copy is shallow copy so copied instances should not be used simultaneously.
3754
+
This iterator is acquired by `sql_result::begin()` and `sql_result::end()`. Hence, this iterator can be used in `range-for` loop. `timeout` is defaulted to `std::chrono::milliseconds{ -1 }` which means wait forever.
3755
+
3756
+
`range-for` loop example:
3757
+
``` C++
3758
+
auto result = client.get_sql().execute("SELECT * FROM integers").get();
3759
+
3760
+
for (const sql_page::sql_row& row : *result) {
3761
+
std::cout << row.get_object<int>(0);
3762
+
}
3763
+
```
3764
+
3765
+
`algorithm` header example:
3766
+
```C++
3767
+
auto result = client.get_sql().execute("SELECT * FROM integers").get();
0 commit comments