wrap an SQLite3 prepared statement More...
#include <sqlite3-statement.hpp>
Public Member Functions | |
Sqlite3Statement (sqlite3 *database, const std::string &statement) | |
initialize and prepare Sqlite3 statement More... | |
~Sqlite3Statement () | |
finalize the statement More... | |
int | bind (int index, const char *value, size_t size, void(*destructor)(void *)) |
bind a string to the statement More... | |
int | bind (int index, const std::string &value, void(*destructor)(void *)) |
bind a string to the statement More... | |
int | bind (int index, const void *value, size_t size, void(*destructor)(void *)) |
bind a byte blob to the statement More... | |
int | bind (int index, const Block &block, void(*destructor)(void *)) |
bind a byte blob to the statement More... | |
int | bind (int index, int number) |
bind an integer to the statement More... | |
const uint8_t * | getBlob (int column) |
get a pointer of byte blob from column . More... | |
Block | getBlock (int column) |
get a block from column . More... | |
int | getInt (int column) |
get an integer from column . More... | |
int | getSize (int column) |
get the size of column . More... | |
std::string | getString (int column) |
get a string from column . More... | |
operator sqlite3_stmt * () | |
implicitly converts to sqlite3_stmt* to be used in SQLite C API More... | |
int | step () |
wrapper of sqlite3_step More... | |
wrap an SQLite3 prepared statement
Definition at line 38 of file sqlite3-statement.hpp.
ndn::util::Sqlite3Statement::Sqlite3Statement | ( | sqlite3 * | database, |
const std::string & | statement | ||
) |
initialize and prepare Sqlite3 statement
database | handler to open sqlite3 database |
statement | SQL statement |
std::domain_error | SQL statement is bad |
Definition at line 34 of file sqlite3-statement.cpp.
ndn::util::Sqlite3Statement::~Sqlite3Statement | ( | ) |
finalize the statement
Definition at line 29 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const char * | value, | ||
size_t | size, | ||
void(*)(void *) | destructor | ||
) |
bind a string to the statement
index | The binding position |
value | The pointer of the binding string |
size | The size of the binding string |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 42 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const std::string & | value, | ||
void(*)(void *) | destructor | ||
) |
bind a string to the statement
index | The binding position |
value | The binding string |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 48 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const void * | value, | ||
size_t | size, | ||
void(*)(void *) | destructor | ||
) |
bind a byte blob to the statement
index | The binding position |
value | The pointer of the blob |
size | The size of the blob |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 54 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const Block & | block, | ||
void(*)(void *) | destructor | ||
) |
bind a byte blob to the statement
index | The binding position |
block | The binding block |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 60 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
int | number | ||
) |
bind an integer to the statement
index | The binding position |
number | The binding integer |
Definition at line 66 of file sqlite3-statement.cpp.
const uint8_t * ndn::util::Sqlite3Statement::getBlob | ( | int | column | ) |
get a pointer of byte blob from column
.
Definition at line 93 of file sqlite3-statement.cpp.
Block ndn::util::Sqlite3Statement::getBlock | ( | int | column | ) |
get a block from column
.
Definition at line 79 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::getInt | ( | int | column | ) |
get an integer from column
.
Definition at line 86 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::getSize | ( | int | column | ) |
get the size of column
.
Definition at line 99 of file sqlite3-statement.cpp.
std::string ndn::util::Sqlite3Statement::getString | ( | int | column | ) |
get a string from column
.
Definition at line 72 of file sqlite3-statement.cpp.
ndn::util::Sqlite3Statement::operator sqlite3_stmt * | ( | ) |
implicitly converts to sqlite3_stmt* to be used in SQLite C API
Definition at line 110 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::step | ( | ) |
wrapper of sqlite3_step
Definition at line 105 of file sqlite3-statement.cpp.