summaryrefslogtreecommitdiffhomepage
path: root/storage.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2022-12-30 15:07:39 +0100
committerRoland Reichwein <mail@reichwein.it>2022-12-30 15:07:39 +0100
commitaf1c4ee4d74ff7afc997372802d851d11daad418 (patch)
tree745761113c41ccbe6ea37119b51b609a219882c9 /storage.cpp
parent3f3d579c6a6f9a1a31278221f85b3194e3b6c5f4 (diff)
Added tests, added sqlite-backed storage (WIP!)
Diffstat (limited to 'storage.cpp')
-rw-r--r--storage.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/storage.cpp b/storage.cpp
new file mode 100644
index 0000000..9dc7615
--- /dev/null
+++ b/storage.cpp
@@ -0,0 +1,17 @@
+#include "storage.h"
+
+#include "config.h"
+
+#include <SQLiteCpp/SQLiteCpp.h>
+
+Storage::Storage(const Config& config): m_config(config)
+{
+ SQLite::Database db(m_config.getDataPath() + "/whiteboard.db3", SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
+
+ db.exec("CREATE TABLE IF NOT EXISTS documents (id INTEGER PRIMARY KEY, value TEXT)");
+}
+
+std::string Storage::getDocument()
+{
+ return "";
+}