-
Notifications
You must be signed in to change notification settings - Fork 0
Database
A Database object is a wrapper around a raw sqlite3* pointer. The pointer
is stored in a boost::shared_ptr, making Databases instances flyweight and
copyable. When the last Database object owning a given sqlite3* pointer is
deleted, the connection is closed.
-
Database()Constructs an empty database object.
-
Database(const char* filename)Constructs a new database / opens an existing database.
-
bool connected() constAnswers whether the given instance is connected to a real database.
database.connected()is equivalent todata.raw_data() != 0. -
Statement make(const char* query) constPrepares a statement from the given query.
-
sqlite3* raw_data() constAccess the underlying raw
sqlite3*pointer. It is not meant to be stored, as its lifetime is managed via reference counting in the database type itself.
-
void connect(const char* filename)Constructs a new database / opens an existing databse.
-
void disconnect()Disconnects the instance from its current database if any.
Rows exec(const char* query) const
Execute a query against the database and return the corresponding rows.
Rows exec(const char* query, const Parameters& params) constvoid exec(const char* query, const RowCallback& callback) constvoid exec(const char* query, const RowCallback& callback, const Parameters& params) constRowRange result(const char* query) constRowRange result(const char* query, const Parameters& params) const