5#ifndef BOOST_SQLITE_RESULTSET_HPP
6#define BOOST_SQLITE_RESULTSET_HPP
9#include <boost/sqlite/row.hpp>
10#include <boost/describe/members.hpp>
12#include <boost/system/result.hpp>
14BOOST_SQLITE_BEGIN_NAMESPACE
50 bool done()
const {
return done_;}
59 std::size_t column_count()
const
61 return sqlite3_column_count(impl_.get());
66 return sqlite3_column_name(impl_.get(), idx);
71 return sqlite3_column_table_name(impl_.get(), idx);
76 return sqlite3_column_origin_name(impl_.get(), idx);
83 using difference_type = int;
85 using iterator_category = std::forward_iterator_tag;
88 explicit iterator(sqlite3_stmt * stmt,
bool sentinel) : sentinel_(sentinel )
95 return sentinel_ != rhs.sentinel_;
98 row &operator*() {
return row_; }
99 row *operator->() {
return &row_; }
113 bool sentinel_ =
true;
127 constexpr deleter_() noexcept {}
129 void operator()(sqlite3_stmt * sm)
131 if (sqlite3_data_count(sm) > 0)
132 while ( sqlite3_step(sm) == SQLITE_ROW);
134 sqlite3_finalize(sm);
137 sqlite3_clear_bindings(sm);
143 std::unique_ptr<sqlite3_stmt, deleter_> impl_;
147BOOST_SQLITE_END_NAMESPACE
main object for a connection to a database.
Additional information about error conditions stored in an sqlite-allocate string.
The input iterator can be used to read every row in a for-loop.
Representation of a result from a database.
iterator begin()
Return an input iterator to the currently unread row.
core::string_view column_origin_name(std::size_t idx) const
Returns the origin name of the column for column idx.
iterator end()
Sentinel iterator.
row current() const &
Returns the current row.
core::string_view table_name(std::size_t idx) const
Returns the name of the source table for column idx.
core::string_view column_name(std::size_t idx) const
Returns the name of the column idx.
bool done() const
Checks if the last row has been reached.
bool read_next(system::error_code &ec, error_info &ei)
Representation of a row in a database.
A statement used for a prepared-statement.
A holder for a sqlite values used for internal APIs.