Represents a single row from a database result.
More...
#include <relx/results/result.hpp>
|
| | Row (std::vector< Cell > cells, std::vector< std::string > column_names={}) |
| | Constructs a row with cells and column names.
|
| |
| ResultProcessingResult< const Cell * > | get_cell (size_t index) const |
| | Get a cell by index.
|
| |
| ResultProcessingResult< const Cell * > | get_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 allow_numeric_bools.
|
| |
| 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 allow_numeric_bools.
|
| |
| template<typename T , typename ColType > |
| ResultProcessingResult< T > | get (const ColType &column) const |
| | Get a typed value using a schema column object.
|
| |
| template<typename T , typename ColType > |
| ResultProcessingResult< T > | get (const ColType &column, bool allow_numeric_bools) const |
| | Get a typed value using a schema column object with allow_numeric_bools.
|
| |
| template<auto MemberPtr> |
| auto | get () const |
| | Get a typed value using a member pointer.
|
| |
| template<auto MemberPtr> |
| auto | get_optional () const |
| | Get an optional typed value using a member pointer.
|
| |
| size_t | size () const |
| | Get the number of cells in this row.
|
| |
| const std::vector< std::string > & | column_names () const |
| | Get the column names.
|
| |
| std::string | to_string () const |
| |
Represents a single row from a database result.
Definition at line 349 of file result.hpp.
◆ Row()
| relx::result::Row::Row |
( |
std::vector< Cell > |
cells, |
|
|
std::vector< std::string > |
column_names = {} |
|
) |
| |
|
inlineexplicit |
Constructs a row with cells and column names.
- Parameters
-
| cells | The raw cell values |
| column_names | The column names (optional) |
Definition at line 354 of file result.hpp.
◆ column_names()
| const std::vector< std::string > & relx::result::Row::column_names |
( |
| ) |
const |
|
inline |
Get the column names.
- Returns
- The column names (may be empty)
Definition at line 531 of file result.hpp.
◆ get() [1/7]
template<auto MemberPtr>
| auto relx::result::Row::get |
( |
| ) |
const |
|
inline |
Get a typed value using a member pointer.
- Template Parameters
-
| MemberPtr | Pointer to a class member |
- Returns
- The parsed value
Definition at line 497 of file result.hpp.
◆ get() [2/7]
template<typename T , typename ColType >
Get a typed value using a schema column object.
- Template Parameters
-
| T | The target C++ type |
| ColType | The column type |
- Parameters
-
- Returns
- The parsed value
Definition at line 440 of file result.hpp.
◆ get() [3/7]
template<typename T , typename ColType >
Get a typed value using a schema column object with allow_numeric_bools.
- Template Parameters
-
| T | The target C++ type |
| ColType | The column type |
- Parameters
-
| column | The column object |
| allow_numeric_bools | Whether to allow integers (0/1) to be converted to booleans |
- Returns
- The parsed value
Definition at line 451 of file result.hpp.
◆ get() [4/7]
Get a typed value by column name.
- Template Parameters
-
- Parameters
-
| name | The name of the column |
- Returns
- The parsed value
Definition at line 416 of file result.hpp.
◆ get() [5/7]
template<typename T >
| ResultProcessingResult< T > relx::result::Row::get |
( |
const std::string & |
name, |
|
|
bool |
allow_numeric_bools |
|
) |
| const |
|
inline |
Get a typed value by column name with allow_numeric_bools.
- Template Parameters
-
- Parameters
-
| name | The name of the column |
| allow_numeric_bools | Whether to allow integers (0/1) to be converted to booleans |
- Returns
- The parsed value
Definition at line 426 of file result.hpp.
◆ get() [6/7]
Get a typed value by index.
- Template Parameters
-
- Parameters
-
| index | The zero-based index of the cell |
- Returns
- The parsed value
Definition at line 393 of file result.hpp.
◆ get() [7/7]
Get a typed value by index with allow_numeric_bools.
- Template Parameters
-
- Parameters
-
| index | The zero-based index of the cell |
| allow_numeric_bools | Whether to allow integers (0/1) to be converted to booleans |
- Returns
- The parsed value
Definition at line 403 of file result.hpp.
◆ get_cell() [1/2]
Get a cell by column name.
- Parameters
-
| name | The name of the column |
- Returns
- The cell for the specified column
Definition at line 370 of file result.hpp.
◆ get_cell() [2/2]
Get a cell by index.
- Parameters
-
| index | The zero-based index of the cell |
- Returns
- The cell at the specified index
Definition at line 360 of file result.hpp.
◆ get_optional()
template<auto MemberPtr>
| auto relx::result::Row::get_optional |
( |
| ) |
const |
|
inline |
Get an optional typed value using a member pointer.
- Template Parameters
-
| MemberPtr | Pointer to a class member |
- Returns
- The parsed value as an optional
Definition at line 513 of file result.hpp.
◆ size()
| size_t relx::result::Row::size |
( |
| ) |
const |
|
inline |
Get the number of cells in this row.
- Returns
- The number of cells
Definition at line 527 of file result.hpp.
◆ to_string()
| std::string relx::result::Row::to_string |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: