21 #include "SQLamarr/CleanEventStore.h"
31 "SELECT name FROM sqlite_master WHERE type='table'");
32 sqlite3_stmt* list_temp_tables =
get_statement(
"list_temp_tables",
33 "SELECT name FROM sqlite_temp_master WHERE type='table'");
35 std::vector<std::string> tables;
38 reinterpret_cast<const char *
>(sqlite3_column_text(list_tables, 0))
43 reinterpret_cast<const char *
>(sqlite3_column_text(list_temp_tables, 0))
47 for (
auto& table: tables)
49 sprintf(buffer,
"DELETE FROM %s", table.c_str());
sqlite3_stmt * get_statement(const std::string &name, const std::string &query)
Creates or retrieve from cache a statement.
bool exec_stmt(sqlite3_stmt *)
Execute a statement, possibly throwing an exception on failure.
void execute() override
Execute the algorithm, cleaning the database.