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

Classes

class  Cell
 Represents a single cell value from a database result. More...
 
struct  column_member_value
 Helper to get the value type from a column member pointer. More...
 
class  LazyCell
 Lazy cell that defers parsing until accessed. More...
 
class  LazyResultSet
 Lazy result set that defers row parsing until accessed. More...
 
class  LazyRow
 Lazy row that defers cell parsing until accessed. More...
 
struct  ResultError
 Error type for result processing operations. More...
 
class  ResultSet
 Represents the result set from a database query. More...
 
class  Row
 Represents a single row from a database result. More...
 
struct  RowAdapter
 Class to support structured binding for ResultSet. More...
 
struct  RowIterator
 Iterator that yields RowAdapters. More...
 
struct  RowsView
 View class for structured binding support. More...
 
class  StreamingResultSet
 Streaming result set for very large datasets. More...
 

Typedefs

template<typename T >
using ResultProcessingResult = std::expected< T, ResultError >
 Type alias for result of processing operations.
 
template<typename Table , typename ColumnMemberPtr >
using column_member_value_t = typename column_member_value< Table, ColumnMemberPtr >::type
 

Functions

template<query::SqlExpr Query>
LazyResultSet parse_lazy (const Query &, std::string raw_results)
 Parse raw results from a database into a lazy ResultSet.
 
template<typename T , typename C >
static constexpr auto class_of (T C::*)
 Helper to get the class type from a member pointer.
 
template<auto MemberPtr>
constexpr std::string_view get_column_name ()
 Gets the column name from a column member pointer.
 
template<typename Table , typename ColumnMemberPtr >
std::string get_column_name_from_ptr (ColumnMemberPtr ptr)
 Get column name from a member pointer.
 
template<query::SqlExpr Query>
ResultProcessingResult< ResultSetparse (const Query &, const std::string &raw_results)
 Parse raw results from a database into a typed ResultSet (eager parsing)
 

Typedef Documentation

◆ column_member_value_t

template<typename Table , typename ColumnMemberPtr >
using relx::result::column_member_value_t = typedef typename column_member_value<Table, ColumnMemberPtr>::type

Definition at line 58 of file result.hpp.

◆ ResultProcessingResult

template<typename T >
using relx::result::ResultProcessingResult = typedef std::expected<T, ResultError>

Type alias for result of processing operations.

Definition at line 33 of file result.hpp.

Function Documentation

◆ class_of()

template<typename T , typename C >
static constexpr auto relx::result::class_of ( T C::*  )
staticconstexpr

Helper to get the class type from a member pointer.

Definition at line 37 of file result.hpp.

◆ get_column_name()

template<auto MemberPtr>
constexpr std::string_view relx::result::get_column_name ( )
constexpr

Gets the column name from a column member pointer.

Definition at line 43 of file result.hpp.

◆ get_column_name_from_ptr()

template<typename Table , typename ColumnMemberPtr >
std::string relx::result::get_column_name_from_ptr ( ColumnMemberPtr  ptr)

Get column name from a member pointer.

Definition at line 62 of file result.hpp.

◆ parse()

template<query::SqlExpr Query>
ResultProcessingResult< ResultSet > relx::result::parse ( const Query &  ,
const std::string &  raw_results 
)

Parse raw results from a database into a typed ResultSet (eager parsing)

Template Parameters
QueryThe query type
Parameters
queryThe query that was executed
raw_resultsThe raw results as CSV or similar format
Returns
A ResultSet with typed rows

Definition at line 812 of file result.hpp.

◆ parse_lazy()

template<query::SqlExpr Query>
LazyResultSet relx::result::parse_lazy ( const Query &  ,
std::string  raw_results 
)

Parse raw results from a database into a lazy ResultSet.

Template Parameters
QueryThe query type
Parameters
queryThe query that was executed
raw_resultsThe raw results as CSV or similar format
Returns
A LazyResultSet that parses data on demand

Definition at line 406 of file lazy_result.hpp.