summaryrefslogtreecommitdiffhomepage
path: root/storage.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage.h')
-rw-r--r--storage.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/storage.h b/storage.h
index dc4e216..24f2961 100644
--- a/storage.h
+++ b/storage.h
@@ -1,5 +1,6 @@
#pragma once
+#include <memory>
#include <string>
#include <tuple>
@@ -11,6 +12,7 @@ class Storage
{
public:
Storage(const Config& config);
+ ~Storage();
uint64_t getNumberOfDocuments();
bool exists(const std::string& id);
@@ -30,5 +32,20 @@ public:
private:
SQLite::Database m_db;
uint64_t m_maxage;
+
+ // shared_ptr to work around initialization in constructor
+ std::shared_ptr<SQLite::Statement> m_stmt_create;
+ std::shared_ptr<SQLite::Statement> m_stmt_getNumberOfDocuments;
+ std::shared_ptr<SQLite::Statement> m_stmt_cleanup;
+ std::shared_ptr<SQLite::Statement> m_stmt_exists;
+ std::shared_ptr<SQLite::Statement> m_stmt_getDocument;
+ std::shared_ptr<SQLite::Statement> m_stmt_getRevision;
+ std::shared_ptr<SQLite::Statement> m_stmt_getCursorPos;
+ std::shared_ptr<SQLite::Statement> m_stmt_getRow;
+ std::shared_ptr<SQLite::Statement> m_stmt_setDocument;
+ std::shared_ptr<SQLite::Statement> m_stmt_setDocument_new;
+ std::shared_ptr<SQLite::Statement> m_stmt_setRevision;
+ std::shared_ptr<SQLite::Statement> m_stmt_setCursorPos;
+ std::shared_ptr<SQLite::Statement> m_stmt_setRow;
};