Overview

a c++ wrapper for sqlite3

Efficent communication with sqlite3 databases.
Adds type info, and if wanted can also ensures type requirements.

a short usage example:

#include <sq3/database.hpp>

#include <cassert>
#include <iostream>

int main()
{
  using namespace sq3;
  // define a db
  Database db(":memory:");
  // run commands against the db
  db.execute("CREATE TABLE tbl(f1 INTEGER, f2 TEXT, f3 REAL);");
  // create a command with parameters
  auto cmd = db.command("INSERT INTO tbl (f1, f2, f3) VALUES (?,?,?);");
  //add some data
  cmd.execute({ {1}, {"one"}, {1.1} } );
  cmd.execute({ {2}, {"two"}, {2.1} } );

  // access the data
  Dataset ds = db.select("SELECT * FROM tbl;");
  // now the data is available
  assert(ds.size()==2);
  // do something
  for(auto&& row  :ds) {
      // we have some type information
      assert ( row[0].getStorageType() == Type::Int ) ;
      assert ( row[1].getStorageType() == Type::Text ) ;
      assert ( row[2].getStorageType() == Type::Real ) ;
      for (auto&& field : row) {
          std::cout << field << " " ;
      }
      std::cout << std::endl;
  }
}

this will output as expected

1 one 1.1 
2 two 2.1 

Build requirements: optional sqlite3, www.sqlite.org , this is included
required, boost, www.boost.org (header/testing only)

The CMake build contains a target for generating doxygen documentation.
Some usage samples can be found in the test subfolder.

works with gcc 4.8.2 and above and clang 3.3 and above. If Microsoft ever manags to get their compiler C++11 compatible it will also work with MSVC.