Skip to content

MatthieuTexier/sqlpp11-connector-sqlite3

 
 

Repository files navigation

sqlpp11-connector-sqlite

A C++ wrapper for sqlite3 meant to be used in combination with sqlpp11.

Branch / Compiler clang-3.4, gcc-4.9, Xcode-7 MSVC 2015
master Build Status Build status
develop Build Status Build status

Sample Code:

See for instance tests/SampleTest.cpp

namespace sql = sqlpp::sqlite3;
int main() {
    sql::connection_config config;
    config.path_to_database = ":memory:";
    config.flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
    config.debug = true;

    sql::connection db(config);
    std::cerr << __FILE__ << ": " << __LINE__ << std::endl;
    db.execute("CREATE TABLE tab_sample (\
        alpha bigint(20) DEFAULT NULL,\
        beta varchar(255) DEFAULT NULL,\
        gamma bool DEFAULT NULL\
        )");

    TabSample tab;
    // explicit all_of(tab)
    for(const auto& row : db(select(all_of(tab)).from(tab).unconditionally()))
    {
        int64_t alpha = row.alpha;
        std::string beta = row.beta;
        bool gamma = row.gamma;
    };

Requirements:

Compiler: sqlpp11-connector-sqlite3 makes use of C++11 and requires a recent compiler and STL. The following compilers are known to compile the test programs:

  • clang-3.2 on Ubuntu-12.4
  • g++-4.8 on Ubuntu-12.4

Libraries:

About

A C++ wrapper for sqlite3 meant to be used in combination with sqlpp11.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 89.0%
  • CMake 7.5%
  • Python 2.2%
  • C 1.3%