C++ SQLite3 wrapper library
- simple for use
- open with ctor
- database and statement close automatically with dtor by RAII
- support
execute
- support
prepare
,bind
andreset
bind
andreset
are chainable :)
- support low-level controls; eg.
step
,data_element
,data_row
- compile-time optimization friendly
- but, not support indeterminately in compile-time
- header only
- :)
- C++11 standard conformable and seal C API
- rewrite to
enum class
from CPP#define
s - std::tuple for use to data row
- C API was sealed into the namespace
WonderRabbitProject::SQLite3::C
- rewrite to
The library is in the "./include" directory.
#include <WonderRabbitProject/SQLite3.hpp>
using WonderRabbitProject::SQLite3::sqlite3_t;
sqlite3_t database;
database.execute("create table t(a,b,c)");
database.execute("insert into t values(123, 4.5e+6, 'Hello')");
database.execute("insert into t values(987, 6.5e-4, 'World')");
auto statement = database.prepare("select * from t");
auto data = statement.data<int32_t, double, std::string>();
for ( const auto & row : data )
std::cout << std::get<0>(row) << "\n"
<< std::get<1>(row) << "\n"
<< std::get<2>(row) << endl
;
And more examples available in:
- example_01 // basic example
- example_02 // blob example
- example_03 // execute_data example
- C++11
- libqlite3 >= 3.7
(C)2013 Usagi Itousagi@WonderRabbitProject.net / Wonder Rabbit Project.