#include </data/code/userver/odbc/include/userver/storages/odbc/cursor.hpp>
A move-only incremental ODBC result cursor.
Each Fetch materializes at most the requested number of rows into an owning ResultSet. The cursor pins its connection until EOF, destruction, or an error. This bounds memory materialized by userver, but an ODBC driver may still buffer rows internally and server-side streaming is not guaranteed. Fetch calls on a cursor must be sequential.
Definition at line 27 of file cursor.hpp.
Public Member Functions | |
| Cursor (const Cursor &)=delete | |
| Cursor & | operator= (const Cursor &)=delete |
| Cursor (Cursor &&) noexcept | |
| Cursor & | operator= (Cursor &&) noexcept |
| ResultSet | Fetch (std::size_t rows) |
Fetch up to rows and return an owning result chunk. | |
| bool | Done () const noexcept |
| Whether EOF, an error, invalidation, or a moved-from state has made this cursor terminal. | |
| std::size_t | FetchedSoFar () const noexcept |
| Number of rows returned by successful Fetch calls. | |
| operator bool () const noexcept | |
| ResultSet storages::odbc::Cursor::Fetch | ( | std::size_t | rows | ) |
Fetch up to rows and return an owning result chunk.
| LogicError | if rows is zero or the cursor is already terminal. |
|
inlineexplicitnoexcept |
Definition at line 47 of file cursor.hpp.
|
friend |
Definition at line 51 of file cursor.hpp.