#include <sqlite.hpp>
Inheritance diagram for glim::SqliteQuery:

Public Member Functions | |
| SqliteQuery (SqliteSession *session, char const *query, int queryLength) | |
| Prepares the query. | |
| SqliteQuery (SqliteSession *session, std::pair< char const *, int > query) | |
| Prepares the query. | |
| SqliteQuery (SqliteSession *session, std::string query) | |
| Prepares the query. | |
| ~SqliteQuery () | |
| Release resources. | |
| SqliteQuery & | reset () |
| Call this (followed by the step) if you need the query to be re-executed. | |
| bool | next () |
| Synonym for step. | |
| bool | step () |
| Invokes sqlite3_step. | |
| SqliteQuery & | qstep () |
Perform step and throw an exception if step has returned false. | |
| int | ustep () |
| Invokes a DML query and returns the number of rows affected. | |
| int | changes () |
| The number of rows changed by the query. | |
| int | intAt (int column) |
| The integer value of the given column. | |
| int64_t | int64at (int column) |
| The integer value of the given column. | |
| double | doubleAt (int column) |
| The floating point number from the given column. | |
| std::pair< char const *, int > | charsAt (int column) |
| Return the column as UTF-8 characters, which can be used until the next step. | |
| std::string | stringAt (int column) |
| Return the column as C++ string (UTF-8). | |
| int | typeAt (int column) |
| The type of the column. | |
| template<typename T> | |
| SqliteQuery & | operator<< (T value) |
| Binds a value using one of the bind methods. | |
| template<typename T> | |
| SqliteQuery & | bind (char const *name, T value) |
| Binds a value using the named parameter and one of the bind methods. | |
| SqliteQuery & | bind (int index, const char *text, int length, bool transient=false) |
| Bind a string to the query. | |
| SqliteQuery & | bind (int index, std::pair< const char *, int > text, bool transient=false) |
| Bind a string to the query. | |
| SqliteQuery & | bind (int index, std::string text, bool transient=true) |
| Bind a string to the query. | |
| SqliteQuery & | bind (int index, int value) |
| Bind an integer to the query. | |
| SqliteQuery & | bind (int index, long long int value) |
| Bind an 64-bit integer to the query. | |
Protected Member Functions | |
| void | prepare (SqliteSession *session, char const *query, int queryLength) |
Protected Attributes | |
| ::sqlite3_stmt * | statement |
| SqliteSession * | session |
| int | bindCounter |
| int | mChanges |
| -1 if statement isn't DONE. | |
|
||||||||||||||||
|
Prepares the query.
|
|
||||||||||||
|
Prepares the query.
|
|
||||||||||||
|
Prepares the query.
|
|
|
Release resources.
|
|
||||||||||||||||
|
Bind a string to the query.
|
|
||||||||||||||||
|
Bind a string to the query.
|
|
||||||||||||||||||||
|
Bind a string to the query.
|
|
||||||||||||||||
|
Binds a value using the named parameter and one of the bind methods.
|
|
|
The number of rows changed by the query.
Providing the query was a DML (Data Modification Language), returns the number of rows updated. SqliteQuery query (&ses, S("update test set count = count + ? where id = ?")); query.bind (1, 1); query.bind (2, 9); query.step (); int affected = query.changes ();
|
|
|
Return the column as UTF-8 characters, which can be used until the next step.
|
|
|
The floating point number from the given column.
|
|
|
The integer value of the given column.
|
|
|
The integer value of the given column.
|
|
|
Perform step and throw an exception if step has returned Usage example: |
|
|
Call this (followed by the step) if you need the query to be re-executed.
|
|
|
Invokes sqlite3_step.
Reimplemented in glim::SqliteParQuery. |
|
|
Return the column as C++ string (UTF-8).
|
|
|
The type of the column. SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB or SQLITE_NULL.
|
|
|
Invokes a DML query and returns the number of rows affected. Example: |
1.4.6