Classes | |
struct | sqlite3_finalizer |
A specialized dtor to close sqlite3 handles, for use with refcount::rcptr<sqlite3,sqlite3_finalizer >. More... | |
struct | statement_reset_finalizer |
A specialized dtor to reset (not close) sq3::statement objects, for use with refcount::rcptr<sqlite3,statement_reset_finalizer>. More... | |
struct | sqlite3_stmt_reset_finalizer |
A specialized dtor to call reset sqlite3_stmt handles(), for use with refcount::rcptr<sqlite3,sqlite3_stmt_reset_finalizer>. More... | |
struct | sqlite3_stmt_finalizer |
A specialized dtor to finalize sqlite3_stmt handles, for use with refcount::rcptr<sqlite3,sqlite3_stmt_finalizer>. More... | |
class | database |
Encapsulates a connection to an sqlite database. More... | |
class | transaction |
This type represents a transaction block in an SQL session. More... | |
class | cursor |
This type is for stepping through a db query result. More... | |
class | statement |
This class represents a prepared database statement. More... | |
class | log_db |
log_db is a simple logging database for use with arbitrary applications. More... | |
class | settings_db |
settings_db ia a very simplistic key/value pair database for use with the sq3 database layer. More... | |
Typedefs | |
typedef sqlite_int64 | int64_t |
The type used for signed 64-bit integer operations. | |
typedef sqlite_uint64 | uint64_t |
The type used for unsigned 64-bit integer operations. | |
typedef char unsigned | sqlite3_text_char_t |
The published result codes from the sqlite3 API. | |
Functions | |
bool | rc_is_okay (int rc) |
rc_is_okay() is an easy way to check if rc is one of SQLITE_OK, SQLITE_ROW, or SQLITE_DONE. |
It is intended to be an alternative for platforms/projects where exceptions are not desired or not available.
Wide-char support does not currently work. (On my platform (gcc/linux) wchar_t is 4 bytes and sqlite3 wants 2-bytes wide chars for UTF16 text.)
This code was written by stephan beal (stephan@s11n.net) and is released into the Public Domain. It was modelled heavily after code written by Cory Nelson, but was reimplemented from scratch for use on a PocketPC platform where throwing exceptions wasn't allowed.
This code's home page is:
Change history (only "significant" changes documented here):
typedef char unsigned sq3::sqlite3_text_char_t |
The published result codes from the sqlite3 API.
A char type used by some of the sqlite3 API to represent text data. This is really annoying, but sqlite3's API explicitely uses UNSIGNED char arrays for a couple of strings, while using signed char arrays for almost everything else.
bool sq3::rc_is_okay | ( | int | rc | ) |
rc_is_okay() is an easy way to check if rc is one of SQLITE_OK, SQLITE_ROW, or SQLITE_DONE.
This function returns true if rc is one of those values, else false. (Code which accepts arbitrary SQL from a user often has to accept any of those three result codes as success.)
Definition at line 56 of file sq3.cpp.
Referenced by sq3::database::clear(), sq3::settings_db::get(), and sq3::log_db::log().