1#ifndef CYCLUS_SRC_SQLITE_DB_H_
2#define CYCLUS_SRC_SQLITE_DB_H_
6#include <boost/shared_ptr.hpp>
25 typedef boost::shared_ptr<SqlStatement>
Ptr;
57 void BindText(
int i,
const char* val);
61 void BindBlob(
int i,
const void* val,
int n);
68 void Must(
int status);
117 std::vector<StrList>
Query(std::string
cmd);
Thin wrapper class over sqlite3 prepared statements.
double GetDouble(int col)
Returns a double value for the specified column of the current query row.
boost::shared_ptr< SqlStatement > Ptr
int GetInt(int col)
Returns an int value for the specified column of the current query row.
char * GetText(int col, int *n)
Returns a byte array value for the specified column of the current query row.
void BindDouble(int i, double val)
Binds the templated sql parameter at index i to val.
void Reset()
Executes the prepared statement.
bool Step()
Step to next row of previously executed query.
void BindText(int i, const char *val)
Binds the templated sql parameter at index i to val.
void BindInt(int i, int val)
Binds the templated sql parameter at index i to val.
void Exec()
Executes the prepared statement.
void BindBlob(int i, const void *val, int n)
Binds the templated sql parameter at index i to the value pointed to by val.
An abstraction over the Sqlite native C interface to simplify database creation and data insertion.
void Overwrite()
Instead of opening a file of the specified name (if it already exists), overwrite it with a new empty...
void open()
Opens the sqlite database by either opening/creating a file (default) or creating/overwriting a file ...
void close()
Finishes any incomplete operations and closes the database.
void Execute(std::string cmd)
Execute an SQL command.
SqlStatement::Ptr Prepare(std::string sql)
Creates a sqlite prepared statement for the given sql.
SqliteDb(std::string path, bool readonly=false)
Creates a new Sqlite database to be stored at the specified path.
std::vector< StrList > Query(std::string cmd)
Execute an SQL query and return its results.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
std::vector< std::string > StrList
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters