Data row in a result set This class is a mere accessor to underlying result set data buffer, must not be used outside of result set life scope.
Mimics field container
Definition at line 375 of file result_set.hpp.
template<typename T , typename... Y>
auto storages::postgres::Row::As |
( |
| ) |
const |
Parse values from the row and return the result.
If there are more than one type arguments to the function, it will return a tuple of those types.
If there is a single type argument to the function, it will read the first and the only column of the row or the whole row to the row type (depending on C++ to PosgreSQL mapping presence) and return plain value of this type.
- See also
- To(T&&)
Definition at line 848 of file result_set.hpp.
template<typename T >
void storages::postgres::Row::To |
( |
T && |
val | ) |
const |
Read the contents of the row to a user's row type or read the first column into the value.
If the user tries to read the first column into a variable, it must be the only column in the result set. If the result set contains more than one column, the function will throw NonSingleColumnResultSet. If the result set is OK to contain more than one columns, the first column value should be accessed via row[0].To/As
.
If the type is a 'row' type, the function will read the fields of the row into the type's data members.
If the type can be treated as both a row type and a composite type (the type is mapped to a PostgreSQL type), the function will treat the type as a type for the first (and the only) column.
To read the all fields of the row as a row type, the To(T&&, RowTag) should be used.
Definition at line 793 of file result_set.hpp.