6 #include "../../sqlite/sqlite3.h"
7 #include "../Common/Common.h"
9 #pragma comment(lib, "../release/sqlite.lib")
13 using namespace Common;
31 static const char* err_descs[] = {
32 {
"Unable to open the database file."},
33 {
"Attempted to use uninitialized data."},
34 {
"Out of bounds access attempt on SQLiteResult or SQLiteRow"},
35 {
"Attempted to bind to an unknown parameter"},
37 {
"The database has been closed and an operation was attempted."},
71 SQLite(
const std::string& path_to_db);
78 std::unique_ptr<SQLiteQuery> NewQuery(
const std::wstring& query);
85 const char* LastError();
137 void prepare_statement();
145 std::unique_ptr<SQLiteResult> Execute();
148 void Reset(
const std::wstring& query);
151 void BindValue(
const char* name,
const SQLiteValue& value);
152 void BindValue(
int index,
const SQLiteValue& value);
163 typedef std::pair<std::string, Object::unique_ptr>
pair_t;
164 std::map<std::string, Object::unique_ptr> columns;
168 const std::string& name);
171 Object& operator[] (
const std::string& key);
172 Object&
get(
const std::string& key);
188 std::vector<std::unique_ptr<SQLiteRow>> rows;
191 void AddRow(std::unique_ptr<SQLiteRow> row);