boost_sqlite 1
A sqlite C++ library
Loading...
Searching...
No Matches
boost::sqlite::static_resultset< T > Struct Template Reference

A typed resultset using a tuple or a described struct. More...

#include <include/boost/sqlite/static_resultset.hpp>

Classes

struct  iterator
 The input iterator can be used to read every row in a for-loop. More...
 

Public Member Functions

iterator begin ()
 Return an input iterator to the currently unread row.
 
core::string_view column_name (std::size_t idx) const
 Returns the name of the column idx.
 
core::string_view column_origin_name (std::size_t idx) const
 Returns the origin name of the column for column idx.
 
current () const &
 Returns the current row.
 
bool done () const
 Checks if the last row has been reached.
 
iterator end ()
 Sentinel iterator.
 
core::string_view table_name (std::size_t idx) const
 Returns the name of the source table for column idx.
 
bool read_next (system::error_code &ec, error_info &ei)
 
bool read_next ()
 

Detailed Description

template<typename T>
struct boost::sqlite::static_resultset< T >

A typed resultset using a tuple or a described struct.

Template Parameters
TThe static type of the query.

If is a forward-range with output iterators.

Example
extern sqlite::connection conn;
struct user { std::string first_name; std::string last_name; };
BOOST_DESCRIBE_STRUCT(user, (), (first_name, last_name));
sqlite::resultset rs = conn.query("select first_name, last_name from users;");
do
{
user usr = r.current();
handle_row(u);
}
while (rs.read_next()) // read it line by line
main object for a connection to a database.
Representation of a result from a database.
Definition resultset.hpp:41
row current() const &
Returns the current row.
Definition resultset.hpp:43
bool read_next(system::error_code &ec, error_info &ei)

Definition at line 272 of file static_resultset.hpp.

Member Function Documentation

◆ read_next() [1/2]

template<typename T >
bool boost::sqlite::static_resultset< T >::read_next ( )
inline

Read the next row. Returns false if there's nothing more to read.

Definition at line 285 of file static_resultset.hpp.

◆ read_next() [2/2]

template<typename T >
bool boost::sqlite::static_resultset< T >::read_next ( system::error_code & ec,
error_info & ei )
inline

Read the next row. Returns false if there's nothing more to read.

Definition at line 284 of file static_resultset.hpp.


The documentation for this struct was generated from the following files: