Exemplo n.º 1
0
 void execute(const std::string& sql)
 {
     int rc=sqlite3_exec(db_, sql.c_str(), 0, 0, 0);
     if (rc != SQLITE_OK)
     {
         throw_sqlite_error(sql);
     }
 }
Exemplo n.º 2
0
    void execute(std::string const& sql)
    {
#ifdef MAPNIK_STATS
        mapnik::progress_timer __stats__(std::clog, std::string("sqlite_resultset::execute ") + sql);
#endif

        const int rc = sqlite3_exec(db_, sql.c_str(), 0, 0, 0);
        if (rc != SQLITE_OK)
        {
            throw_sqlite_error(sql);
        }
    }
Exemplo n.º 3
0
    sqlite_resultset* execute_query(const std::string& sql)
    {
        sqlite3_stmt* stmt = 0;

        int rc = sqlite3_prepare_v2 (db_, sql.c_str(), -1, &stmt, 0);
        if (rc != SQLITE_OK)
        {
           throw_sqlite_error(sql);
        }

        return new sqlite_resultset (stmt);
    }
Exemplo n.º 4
0
    std::shared_ptr<sqlite_resultset> execute_query(std::string const& sql)
    {
#ifdef MAPNIK_STATS
        mapnik::progress_timer __stats__(std::clog, std::string("sqlite_resultset::execute_query ") + sql);
#endif
        sqlite3_stmt* stmt = 0;

        const int rc = sqlite3_prepare_v2 (db_, sql.c_str(), -1, &stmt, 0);
        if (rc != SQLITE_OK)
        {
            throw_sqlite_error(sql);
        }

        return std::make_shared<sqlite_resultset>(stmt);
    }