relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
relx::result::LazyRow Class Reference

Lazy row that defers cell parsing until accessed. More...

#include <relx/results/lazy_result.hpp>

Public Member Functions

 LazyRow ()
 Default constructor.
 
 LazyRow (std::string_view raw_data, std::vector< std::string > column_names={})
 Constructs a lazy row with raw data and column information.
 
 LazyRow (std::string owned_data, std::vector< std::string > column_names)
 Constructs a lazy row that owns its data (for streaming)
 
 LazyRow (const LazyRow &other)
 Copy constructor.
 
LazyRowoperator= (const LazyRow &other)
 Copy assignment operator.
 
 LazyRow (LazyRow &&other) noexcept
 Move constructor.
 
LazyRowoperator= (LazyRow &&other) noexcept
 Move assignment operator.
 
ResultProcessingResult< LazyCellget_cell (size_t index) const
 Get a cell by index (parsed on demand)
 
ResultProcessingResult< LazyCellget_cell (const std::string &name) const
 Get a cell by column name.
 
template<typename T >
ResultProcessingResult< T > get (size_t index) const
 Get a typed value by index.
 
template<typename T >
ResultProcessingResult< T > get (size_t index, bool allow_numeric_bools) const
 Get a typed value by index with boolean conversion options.
 
template<typename T >
ResultProcessingResult< T > get (const std::string &name) const
 Get a typed value by column name.
 
template<typename T >
ResultProcessingResult< T > get (const std::string &name, bool allow_numeric_bools) const
 Get a typed value by column name with boolean conversion options.
 
size_t size () const
 Get the number of cells in this row.
 
const std::vector< std::string > & column_names () const
 Get the column names.
 

Detailed Description

Lazy row that defers cell parsing until accessed.

Definition at line 57 of file lazy_result.hpp.

Constructor & Destructor Documentation

◆ LazyRow() [1/5]

relx::result::LazyRow::LazyRow ( )
inline

Default constructor.

Definition at line 60 of file lazy_result.hpp.

◆ LazyRow() [2/5]

relx::result::LazyRow::LazyRow ( std::string_view  raw_data,
std::vector< std::string >  column_names = {} 
)
inline

Constructs a lazy row with raw data and column information.

Definition at line 63 of file lazy_result.hpp.

◆ LazyRow() [3/5]

relx::result::LazyRow::LazyRow ( std::string  owned_data,
std::vector< std::string >  column_names 
)
inline

Constructs a lazy row that owns its data (for streaming)

Definition at line 68 of file lazy_result.hpp.

◆ LazyRow() [4/5]

relx::result::LazyRow::LazyRow ( const LazyRow other)
inline

Copy constructor.

Definition at line 75 of file lazy_result.hpp.

◆ LazyRow() [5/5]

relx::result::LazyRow::LazyRow ( LazyRow &&  other)
inlinenoexcept

Move constructor.

Definition at line 104 of file lazy_result.hpp.

Member Function Documentation

◆ column_names()

const std::vector< std::string > & relx::result::LazyRow::column_names ( ) const
inline

Get the column names.

Definition at line 202 of file lazy_result.hpp.

◆ get() [1/4]

template<typename T >
ResultProcessingResult< T > relx::result::LazyRow::get ( const std::string &  name) const
inline

Get a typed value by column name.

Definition at line 181 of file lazy_result.hpp.

◆ get() [2/4]

template<typename T >
ResultProcessingResult< T > relx::result::LazyRow::get ( const std::string &  name,
bool  allow_numeric_bools 
) const
inline

Get a typed value by column name with boolean conversion options.

Definition at line 187 of file lazy_result.hpp.

◆ get() [3/4]

template<typename T >
ResultProcessingResult< T > relx::result::LazyRow::get ( size_t  index) const
inline

Get a typed value by index.

Definition at line 165 of file lazy_result.hpp.

◆ get() [4/4]

template<typename T >
ResultProcessingResult< T > relx::result::LazyRow::get ( size_t  index,
bool  allow_numeric_bools 
) const
inline

Get a typed value by index with boolean conversion options.

Definition at line 171 of file lazy_result.hpp.

◆ get_cell() [1/2]

ResultProcessingResult< LazyCell > relx::result::LazyRow::get_cell ( const std::string &  name) const
inline

Get a cell by column name.

Definition at line 149 of file lazy_result.hpp.

◆ get_cell() [2/2]

ResultProcessingResult< LazyCell > relx::result::LazyRow::get_cell ( size_t  index) const
inline

Get a cell by index (parsed on demand)

Definition at line 137 of file lazy_result.hpp.

◆ operator=() [1/2]

LazyRow & relx::result::LazyRow::operator= ( const LazyRow other)
inline

Copy assignment operator.

Definition at line 86 of file lazy_result.hpp.

◆ operator=() [2/2]

LazyRow & relx::result::LazyRow::operator= ( LazyRow &&  other)
inlinenoexcept

Move assignment operator.

Definition at line 117 of file lazy_result.hpp.

◆ size()

size_t relx::result::LazyRow::size ( ) const
inline

Get the number of cells in this row.

Definition at line 196 of file lazy_result.hpp.


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