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

Represents a single cell value from a database result. More...

#include <relx/results/result.hpp>

Public Member Functions

 Cell (std::string value)
 Constructs a cell with a raw string value from the database.
 
bool is_null () const
 Check if the cell contains a NULL value.
 
const std::string & raw_value () const
 Get the raw string value.
 
template<typename T >
ResultProcessingResult< T > as () const
 Parse the cell's value as the specified type.
 
template<typename T >
ResultProcessingResult< T > as (bool allow_numeric_bools) const
 Parse the cell's value as the specified type with an option to allow numeric boolean conversion.
 

Detailed Description

Represents a single cell value from a database result.

Definition at line 68 of file result.hpp.

Constructor & Destructor Documentation

◆ Cell()

relx::result::Cell::Cell ( std::string  value)
inlineexplicit

Constructs a cell with a raw string value from the database.

Definition at line 71 of file result.hpp.

Member Function Documentation

◆ as() [1/2]

template<typename T >
ResultProcessingResult< T > relx::result::Cell::as ( ) const
inline

Parse the cell's value as the specified type.

Template Parameters
TThe target C++ type
Returns
The parsed value

Definition at line 83 of file result.hpp.

◆ as() [2/2]

template<typename T >
ResultProcessingResult< T > relx::result::Cell::as ( bool  allow_numeric_bools) const
inline

Parse the cell's value as the specified type with an option to allow numeric boolean conversion.

Template Parameters
TThe target C++ type
Parameters
allow_numeric_boolsWhether to allow integers (0/1) to be converted to booleans
Returns
The parsed value

Definition at line 93 of file result.hpp.

◆ is_null()

bool relx::result::Cell::is_null ( ) const
inline

Check if the cell contains a NULL value.

Definition at line 74 of file result.hpp.

◆ raw_value()

const std::string & relx::result::Cell::raw_value ( ) const
inline

Get the raw string value.

Definition at line 77 of file result.hpp.


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