Lightweight 0.1.0
Loading...
Searching...
No Matches
SqlRowIterator< T > Class Template Reference

SQL query result row iterator. More...

#include <SqlStatement.hpp>

Public Member Functions

 SqlRowIterator (SqlConnection &conn)
 
iterator begin ()
 
iterator end () noexcept
 

Detailed Description

template<typename T>
class SqlRowIterator< T >

SQL query result row iterator.

Can be used to iterate over rows of the database and fetch them into a record type.

Template Parameters
TThe record type to fetch the rows into.
struct MyRecord
{
Field<int> field2;
Field<double> field3;
};
for (auto const& row : SqlRowIterator<MyRecord>(stmt))
{
// row is of type MyRecord
// row.field1, row.field2, row.field3 are accessible
}
SQL query result row iterator.
Represents a single column in a table.
Definition Field.hpp:71

Definition at line 472 of file SqlStatement.hpp.

Constructor & Destructor Documentation

◆ SqlRowIterator()

template<typename T >
SqlRowIterator< T >::SqlRowIterator ( SqlConnection conn)
inlineexplicit

Definition at line 475 of file SqlStatement.hpp.

Member Function Documentation

◆ begin()

template<typename T >
iterator SqlRowIterator< T >::begin ( )
inline

Definition at line 536 of file SqlStatement.hpp.

◆ end()

template<typename T >
iterator SqlRowIterator< T >::end ( )
inlinenoexcept

Definition at line 546 of file SqlStatement.hpp.


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