remove sqlite log method from knowledge base

This commit is contained in:
Chris Cromer 2022-12-09 21:13:18 -03:00
parent 57c43a24b4
commit cc080fbd45
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
2 changed files with 1 additions and 10 deletions

View File

@ -23,7 +23,7 @@ obelisk::KnowledgeBase::KnowledgeBase(const char* filename, int flags)
auto result = sqlite3_open_v2(filename, &dbConnection_, flags, NULL);
if (result != SQLITE_OK)
{
logSqliteError(result);
throw new KnowledgeBaseException("database could not be opened");
}
enableForeignKeys();
@ -63,7 +63,6 @@ void obelisk::KnowledgeBase::enableForeignKeys()
&errmsg);
if (result != SQLITE_OK)
{
logSqliteError(result);
if (errmsg)
{
throw obelisk::KnowledgeBaseException(errmsg);
@ -81,7 +80,6 @@ void obelisk::KnowledgeBase::createTable(std::function<const char*()> function)
int result = sqlite3_exec(dbConnection_, function(), NULL, NULL, &errmsg);
if (result != SQLITE_OK)
{
logSqliteError(result);
if (errmsg)
{
throw obelisk::KnowledgeBaseException(errmsg);
@ -171,12 +169,6 @@ void obelisk::KnowledgeBase::getFact(obelisk::Fact& fact)
fact.selectFact(dbConnection_);
}
// TODO: log files? or just throw an error?
void obelisk::KnowledgeBase::logSqliteError(int result)
{
std::cout << sqlite3_errstr(result) << std::endl;
}
void obelisk::KnowledgeBase::getFloat(float& result1,
float& result2,
double var)

View File

@ -22,7 +22,6 @@ namespace obelisk
const char* filename_;
sqlite3* dbConnection_ = nullptr;
int flags_;
void logSqliteError(int result);
void enableForeignKeys();
void createTable(std::function<const char*()> function);