Belle II Software
release-08-01-10
|
SQLite prepared statement wrapper. More...
#include <sqlite.h>
Classes | |
class | iterator |
Iterator class to allow iterating over the rows. More... | |
Public Types | |
using | value_type = ObjectType |
each row gets converted to a instance of this type | |
Public Member Functions | |
iterator | begin () |
Iterator to the beginning. | |
iterator | end () const |
Iterator to the end. | |
ObjectStatement (sqlite3 *db, const std::string &query, bool persistent) | |
Create a statement for an existing database object. | |
~ObjectStatement () | |
Clean up the statement. | |
template<class ... Parameters> | |
ObjectStatement & | execute (Parameters... parameters) |
Execute the statement, providing all necessary parameters. | |
bool | step () |
Step to the next row in the result. More... | |
value_type | getRow () const |
Return the current row. | |
Private Attributes | |
sqlite3_stmt * | m_statement {nullptr} |
pointer to the statement object | |
SQLite prepared statement wrapper.
This class is meant to prepare a SQLite statement where each row of the result is supposed to fill one object of type ObjectType.
Columns is the type of each of the columns in the returned data. When calling getRow() the selected columns from the current result row will be converted to the typesspecified by Columns and passed to the constructor of ObjectType and the resulting object is returned.
After calling execute one can iterate over the statement to get all rows.
|
inline |
Step to the next row in the result.
Definition at line 267 of file sqlite.h.