Lightweight 0.20250904.0
Loading...
Searching...
No Matches
Lightweight::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 Lightweight::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:84

Definition at line 494 of file SqlStatement.hpp.

Constructor & Destructor Documentation

◆ SqlRowIterator()

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

Definition at line 497 of file SqlStatement.hpp.

Member Function Documentation

◆ begin()

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

Definition at line 558 of file SqlStatement.hpp.

◆ end()

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

Definition at line 568 of file SqlStatement.hpp.


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