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

Detailed Description

Definition at line 121 of file response.hpp.

Public Member Functions

 Cursor (const Cursor &)=delete
 Cursor (Cursor &&) noexcept=default
Cursor & operator= (const Cursor &)=delete
Cursor & operator= (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 277 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 299 of file response.hpp.

◆ AsSingleRow()

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

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

Exceptions
EmptyResponseErrorif Cursor::empty.

Definition at line 294 of file response.hpp.

◆ empty()

bool ydb::Cursor::empty ( ) const
Returns
true if the cursor has no rows

◆ 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 Cursor::empty.
IgnoreResultsErrorif Cursor::size > 1.

◆ IsTruncated()

bool ydb::Cursor::IsTruncated ( ) const

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

◆ size()

std::size_t ydb::Cursor::size ( ) const
Returns
the number of rows in the cursor

◆ CursorIterator

friend class CursorIterator
friend

Definition at line 171 of file response.hpp.

◆ Row

friend class Row
friend

Definition at line 170 of file response.hpp.


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