userver: storages::odbc::Cursor Class Reference
Loading...
Searching...
No Matches
storages::odbc::Cursor Class Referencefinal

#include </data/code/userver/odbc/include/userver/storages/odbc/cursor.hpp>

Detailed Description

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

Member Function Documentation

◆ Fetch()

ResultSet storages::odbc::Cursor::Fetch ( std::size_t rows)

Fetch up to rows and return an owning result chunk.

Exceptions
LogicErrorif rows is zero or the cursor is already terminal.

◆ operator bool()

storages::odbc::Cursor::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 47 of file cursor.hpp.

◆ Transaction

friend class Transaction
friend

Definition at line 51 of file cursor.hpp.


The documentation for this class was generated from the following file:
  • /data/code/userver/odbc/include/userver/storages/odbc/cursor.hpp