xc
|
SQL Statement execute / result. More...
#include <Query.h>
Public Member Functions | |
Query (Database &dbin) | |
Constructor accepting reference to database object. More... | |
Query (Database &dbin, const std::string &sql) | |
Constructor accepting reference to database object and query string to execute. More... | |
bool | Connected () |
Check if database object is connectable. More... | |
Database & | GetDatabase () const |
Return reference to database object. More... | |
const std::string & | GetLastQuery (void) const |
Return string containing last query executed. More... | |
bool | execute (const std::string &sql) |
execute() returns true if query is successful, does not store result. More... | |
bool | insert_blob1 (const std::string &sql, const void *blobData, const size_t &numBytes) |
Inserta un blob en la posición indicada por el primer signo de interrogación que aparece en la sentencia SQL. | |
sqlite3_stmt * | get_result (const std::string &sql) |
Execute query and store result. More... | |
void | free_result () |
Free stored result, must be called after get_result() before calling execute()/get_result() again. More... | |
bool | fetch_row (void) |
Fetch next result row. More... | |
sqlite_int64 | insert_id () |
Get id of last insert. More... | |
long | num_rows (void) const |
Returns 0 if there are no rows to fetch. | |
size_t | num_columns (void) const |
Return the number of columns of the query. | |
std::string | field_names (void) const |
Return a string with the fields names. | |
int | field_index (const std::string &str) |
std::string | getError (void) const |
Last error string. More... | |
int | GetErrno () |
Last error code. More... | |
const char * | get_string (const std::string &sql) |
Execute query and return first result as a string. More... | |
long | get_count (const std::string &sql) |
Execute query and return first result as a long integer. More... | |
double | get_num (const std::string &sql) |
Execute query and return first result as a double. More... | |
bool | is_null (int x) |
Check if column x in current row is null. More... | |
const void * | getblob (const std::string &x) |
Return column named x as a blob value. More... | |
const void * | getblob (int x) |
Return column x as a blob value. More... | |
const void * | getblob () |
Return next column as a string value - see rowcount. More... | |
const char * | getstr (const std::string &x) |
Return column named x as a string value. More... | |
const char * | getstr (int x) |
Return column x as a string value. More... | |
const char * | getstr () |
Return next column as a string value - see rowcount. More... | |
long | getval (const std::string &x) |
Return column named x as a long integer. More... | |
long | getval (int x) |
Return column x as a long integer. More... | |
long | getval () |
Return next column as a long integer - see rowcount. More... | |
unsigned long | getuval (const std::string &x) |
Return column named x as an unsigned long integer. More... | |
unsigned long | getuval (int x) |
Return column x as an unsigned long integer. More... | |
unsigned long | getuval () |
Return next column as an unsigned long integer. More... | |
int64_t | getbigint (const std::string &x) |
Return column named x as a 64-bit integer value. More... | |
int64_t | getbigint (int x) |
Return column x as a 64-bit integer value. More... | |
int64_t | getbigint () |
Return next column as a 64-bit integer value. More... | |
uint64_t | getubigint (const std::string &x) |
Return column named x as an unsigned 64-bit integer value. More... | |
uint64_t | getubigint (int x) |
Return column x as an unsigned 64-bit integer value. More... | |
uint64_t | getubigint () |
Return next column as an unsigned 64-bit integer value. More... | |
double | getnum (const std::string &x) |
Return column named x as a double. More... | |
double | getnum (int x) |
Return column x as a double. More... | |
double | getnum () |
Return next column as a double. More... | |
SQL Statement execute / result.
Query::Query | ( | Database & | dbin | ) |
Constructor accepting reference to database object.
Query::Query | ( | Database & | dbin, |
const std::string & | sql | ||
) |
Constructor accepting reference to database object and query string to execute.
bool Query::Connected | ( | void | ) |
Check if database object is connectable.
bool Query::execute | ( | const std::string & | sql | ) |
execute() returns true if query is successful, does not store result.
bool Query::fetch_row | ( | void | ) |
Fetch next result row.
void Query::free_result | ( | void | ) |
Free stored result, must be called after get_result() before calling execute()/get_result() again.
long Query::get_count | ( | const std::string & | sql | ) |
Execute query and return first result as a long integer.
double Query::get_num | ( | const std::string & | sql | ) |
Execute query and return first result as a double.
sqlite3_stmt * Query::get_result | ( | const std::string & | sql | ) |
Execute query and store result.
const char * Query::get_string | ( | const std::string & | sql | ) |
Execute query and return first result as a string.
int64_t Query::getbigint | ( | const std::string & | x | ) |
Return column named x as a 64-bit integer value.
int64_t Query::getbigint | ( | int | x | ) |
Return column x as a 64-bit integer value.
int64_t Query::getbigint | ( | ) |
Return next column as a 64-bit integer value.
const void * Query::getblob | ( | const std::string & | x | ) |
Return column named x as a blob value.
const void * Query::getblob | ( | int | x | ) |
Return column x as a blob value.
const void * Query::getblob | ( | void | ) |
Return next column as a string value - see rowcount.
Database & Query::GetDatabase | ( | ) | const |
Return reference to database object.
int Query::GetErrno | ( | void | ) |
Last error code.
std::string Query::getError | ( | void | ) | const |
Last error string.
const std::string & Query::GetLastQuery | ( | void | ) | const |
Return string containing last query executed.
double Query::getnum | ( | const std::string & | x | ) |
Return column named x as a double.
double Query::getnum | ( | int | x | ) |
Return column x as a double.
double Query::getnum | ( | void | ) |
Return next column as a double.
const char * Query::getstr | ( | const std::string & | x | ) |
Return column named x as a string value.
const char * Query::getstr | ( | int | x | ) |
Return column x as a string value.
const char * Query::getstr | ( | void | ) |
Return next column as a string value - see rowcount.
uint64_t Query::getubigint | ( | const std::string & | x | ) |
Return column named x as an unsigned 64-bit integer value.
uint64_t Query::getubigint | ( | int | x | ) |
Return column x as an unsigned 64-bit integer value.
uint64_t Query::getubigint | ( | ) |
Return next column as an unsigned 64-bit integer value.
unsigned long Query::getuval | ( | const std::string & | x | ) |
Return column named x as an unsigned long integer.
unsigned long Query::getuval | ( | int | x | ) |
Return column x as an unsigned long integer.
unsigned long Query::getuval | ( | void | ) |
Return next column as an unsigned long integer.
long Query::getval | ( | const std::string & | x | ) |
Return column named x as a long integer.
long Query::getval | ( | int | x | ) |
Return column x as a long integer.
long Query::getval | ( | void | ) |
Return next column as a long integer - see rowcount.
sqlite_int64 Query::insert_id | ( | ) |
Get id of last insert.
bool Query::is_null | ( | int | x | ) |
Check if column x in current row is null.