Sqlitepp is a simple wrapper for sqlite. It simply adds RAII to the most commonly used sqlite types and a few convenience methods for their most used functionality. Sqlitepp types have a get_c_obj() method to gain access to the underlying sqlite type, which allows you to use any part of the sqlite C library not wrapped by sqlitepp. That way you can take advantage of sqlitepp without losing any functionality.
The library is split into 4 modules:
sqlite::Connection (corresponds to sqlite's sqlite3 type)
Represents the sqlite database connection itself.
sqlite::Connection::Stmt (corresponds to sqlite's sqlite3_stmt type)
A prepared SQL statement. Can be created directly, or from sqlite::Connection::create_statement
Exception types thrown from Connection and Stmt. sqlite::Error is an abstract type, and should not be directly created, but may be caught. sqlite::Runtime_error and sqlite::Logic_error inherit from c++'s std::runtime_error and std::logic_error, respectively.
A simple service locator object for use with Connection. This is provided as a convinence, and is not required to use the rest of the library.
- Sqlite
Sqlitepp uses CMake to build:
$ mkdir build && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=<prefix path> # add -DBUILD_SHARED_LIBS for a shared libary
$ make
# make install
Sqlitepp is configured to generate a .deb package file. To do so, substitute the above with the following:
$ mkdir build && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1
$ make
$ cpack
# dpkg -i libsqlitepp-dev*.deb
When linking your own code using sqlitepp, you will need to link to both the
sqlitepp and sqlite3 libraries: -lsqlitepp -lsqlite3
(depending on your OS)
If doxygen is installed, library documentation can be generated with: $ make doc