Giter Site home page Giter Site logo

emaxerrno / sqlpp11-connector-sqlite3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rbock/sqlpp11-connector-sqlite3

0.0 1.0 0.0 106 KB

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

License: BSD 2-Clause "Simplified" License

sqlpp11-connector-sqlite3's Introduction

sqlpp11-connector-sqlite

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

Sample Code:

See for instance test/SampleTest.cpp

namespace sql = sqlpp::sqlite3;
int main()
{
    auto config = std::make_shared<sql::connection_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 bool DEFAULT NULL,\
        gamma varchar(255) DEFAULT NULL\
        )");

    TabSample tab;
    // explicit all_of(tab)
    for(const auto& row : db.run(select(all_of(tab)).from(tab).where(true)))
    {
        int64_t alpha = row.alpha;
        bool beta = row.beta;
        std::string 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

C++ SQL Layer: sqlpp11-connector-sqlite3 is meant to be used with sqlpp11 (https://github.com/rbock/sqlpp11).

sqlite3: libsqlite3, version 3.7.11 or later is required to use multi-row insert. Older versions (e.g. 3.7.9) work fine otherwise.

sqlpp11-connector-sqlite3's People

Contributors

rbock avatar

Watchers

Alexander Gallego avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.