From f7160a063d5dedd9525b306534109b96087f1896 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 29 Jan 2023 13:19:33 +0100 Subject: Add SQL VACUUM to cleanup --- compiledsql.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'compiledsql.h') diff --git a/compiledsql.h b/compiledsql.h index 7510408..bb1062c 100644 --- a/compiledsql.h +++ b/compiledsql.h @@ -9,10 +9,8 @@ class CompiledSQL { public: - CompiledSQL(SQLite::Database& db); + CompiledSQL(SQLite::Database& db, const std::string& stmt); - void init(const std::string& stmt); - // index 1-based as in SQLite template void bind(int index, T value) @@ -29,8 +27,19 @@ public: return m_stmt->getColumn(index); } + class Guard + { + public: + Guard(CompiledSQL& cs); + ~Guard(); + private: + CompiledSQL& m_cs; + }; + private: - std::shared_ptr m_stmt; SQLite::Database& m_db; + std::string m_query; + std::shared_ptr m_stmt; bool m_isSelect; // In SQLite, SELECT statements will be handled w/ executeStep(), others w/ exec() }; + -- cgit v1.2.3