userver: ydb::Cursor Class Reference
Loading...
Searching...
No Matches
ydb::Cursor Class Referencefinal

Detailed Description

Definition at line 118 of file response.hpp.

Public Member Functions

 Cursor (const Cursor &)=delete
 
 Cursor (Cursor &&) noexcept=default
 
Cursoroperator= (const Cursor &)=delete
 
Cursoroperator= (Cursor &&) noexcept=default
 
size_t ColumnsCount () const
 
size_t RowsCount () const
 
Row GetFirstRow ()
 
Row GetSingleRow () &&
 Extract first row.
 
template<typename Container>
Container AsContainer () &&
 Extract data into a container. Each row is parsed using Row::As.
 
template<typename T>
AsSingleRow () &&
 Extract first row into user type using Row::As.
 
template<typename T>
std::optional< T > AsOptionalSingleRow () &&
 Extract first row into user type using Row::As.
 
bool IsTruncated () const
 
bool empty () const
 
std::size_t size () const
 
CursorIterator begin ()
 
std::default_sentinel_t end ()
 

Member Function Documentation

◆ AsContainer()

template<typename Container>
Container ydb::Cursor::AsContainer ( ) &&

Extract data into a container. Each row is parsed using Row::As.

Definition at line 273 of file response.hpp.

◆ AsOptionalSingleRow()

template<typename T>
std::optional< T > ydb::Cursor::AsOptionalSingleRow ( ) &&

Extract first row into user type using Row::As.

Returns
A single row result set if non empty result was returned, empty std::optional otherwise

Definition at line 295 of file response.hpp.

◆ AsSingleRow()

template<typename T>
T ydb::Cursor::AsSingleRow ( ) &&

Extract first row into user type using Row::As.

Exceptions
EmptyResponseErrorif empty().

Definition at line 290 of file response.hpp.

◆ GetFirstRow()

Row ydb::Cursor::GetFirstRow ( )
Exceptions
EmptyResponseErrorif GetFirstRow() or begin() called before or cursor is empty

◆ GetSingleRow()

Row ydb::Cursor::GetSingleRow ( ) &&

Extract first row.

Exceptions
EmptyResponseErrorif empty().
IgnoreResultsErrorif size() > 1.

◆ IsTruncated()

bool ydb::Cursor::IsTruncated ( ) const

Returns true if response has been truncated to the database limit (currently 1000 rows)

Friends And Related Symbol Documentation

◆ CursorIterator

friend class CursorIterator
friend

Definition at line 166 of file response.hpp.

◆ Row

friend class Row
friend

Definition at line 165 of file response.hpp.


The documentation for this class was generated from the following file: