23 #ifndef SQLITE_CONNECTOR
24 #define SQLITE_CONNECTOR
26 #include <boost/lexical_cast.hpp>
35 SqliteConnector(
const std::string& dbName,
const std::string& dir =
".");
40 void reset(
const std::string& path) {
42 sqlite3_open(path.c_str(), &
db_);
45 virtual void query(
const std::string& queryString);
50 template <
typename STRING_CONTAINER>
53 *query_and_text_params.begin(),
54 std::vector<std::string>{std::next(query_and_text_params.begin()),
55 query_and_text_params.end()});
58 const std::vector<std::string>& text_param);
62 const std::vector<std::string>& text_params,
63 const std::vector<BindType>& bind_types);
66 const std::string& text_param);
69 std::vector<std::vector<std::string>>& insert_vals);
76 assert(row < static_cast<int>(
numRows_));
77 assert(col < static_cast<int>(
numCols_));
78 return boost::lexical_cast<
T>(
results_[col][row].result);
81 bool isNull(
const int row,
const int col)
const {
82 assert(row < static_cast<int>(
numRows_));
83 assert(col < static_cast<int>(
numCols_));
108 #endif // SQLITE_CONNECTOR
T getData(const int row, const int col)
virtual void query_with_text_params(std::string const &query_only)
virtual void batch_insert(const std::string &table_name, std::vector< std::vector< std::string >> &insert_vals)
virtual void query(const std::string &queryString)
std::vector< std::vector< NullableResult > > results_
void reset(const std::string &path)
std::vector< int > columnTypes
bool isNull(const int row, const int col) const
void query_with_text_params(STRING_CONTAINER const &query_and_text_params)
virtual ~SqliteConnector()
virtual size_t getNumCols() const
std::vector< std::string > columnNames
auto getSqlitePtr() const
virtual void query_with_text_param(const std::string &queryString, const std::string &text_param)
virtual size_t getNumRows() const