diff --git a/lib/sql3.hpp b/lib/sql3.hpp index 9f83063..37762d4 100644 --- a/lib/sql3.hpp +++ b/lib/sql3.hpp @@ -22,7 +22,6 @@ class sql3 { sqlite3* db; string path; bool keepOpen; - // map> model; string Answer; map> parsed; diff --git a/src/sql3.cpp b/src/sql3.cpp index c31f27c..7e29b20 100644 --- a/src/sql3.cpp +++ b/src/sql3.cpp @@ -6,7 +6,7 @@ sql3::sql3(const string _path, bool _keepOpen) { if (keepOpen) { if (open()) { - throw "[ERROR] Unable to open database "; + throw string("[ERROR] Unable to open database "); } } @@ -27,7 +27,7 @@ bool sql3::run(const string sql_command) { if (!keepOpen) { if (open()) { - throw "[ERROR] Unable to open database "; + throw string("[ERROR] Unable to open database "); } } @@ -47,7 +47,7 @@ bool sql3::run(const string sql_command) { if (!keepOpen) { if(close()) { - throw "[ERROR] Unable to close database "; + throw string("[ERROR] Unable to close database "); } } @@ -62,7 +62,7 @@ string sql3::answer() { string sql3::ask(const string sql_command) { if (!run(sql_command)) { - throw "[ERROR] Unable to read database "; + throw string("[ERROR] Unable to read database "); //return {}; } else { @@ -72,7 +72,7 @@ string sql3::ask(const string sql_command) { map> sql3::query(const string sql_command) { if (!run(sql_command)) { - throw "[ERROR] Unable to read database "; + throw string("[ERROR] Unable to read database "); //return {}; } else { @@ -104,7 +104,7 @@ void sql3::mapit() { sql3::~sql3() { if(close()) { - throw "[ERROR] Unable to close database "; + throw string("[ERROR] Unable to close database "); } } @@ -117,6 +117,7 @@ static int callback(void* data, int argc, char** argv, char** azColName) { int i; fprintf(stderr, "%s: ", (const char*)data); char res[1000]; + responseDatabase.clear(); for (i = 0; i < argc; i++) { sprintf(res, "%s = %s", azColName[i], argv[i] ? argv[i] : "NULL"); responseDatabase += res; diff --git a/test/test.o b/test/test.o index b364b55..17505af 100755 Binary files a/test/test.o and b/test/test.o differ