aboutsummaryrefslogtreecommitdiff
path: root/frontend/DB.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-29 23:30:57 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-29 23:30:57 +0100
commit5c34847218e8d754447f5cf71ed595bbb412eee7 (patch)
tree2872948e6d2f566dd66cb1a9b2a5d9900db4c44f /frontend/DB.h
parenta04cb74fee079e3ee43ae5fae32fc2674409822c (diff)
more WIP
Diffstat (limited to 'frontend/DB.h')
-rw-r--r--frontend/DB.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/DB.h b/frontend/DB.h
new file mode 100644
index 0000000..b464f9f
--- /dev/null
+++ b/frontend/DB.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <memory>
+#include <functional>
+#include <sqlite3.h>
+
+class DB {
+ typedef std::unique_ptr<sqlite3, std::function<void(sqlite3*)>> unique_sqlite3;
+ typedef std::unique_ptr<sqlite3_stmt, std::function<void(sqlite3_stmt*)>> unique_sqlite3_stmt;
+
+public:
+ DB(const std::string & path);
+ unique_sqlite3_stmt prepare(const std::string & query);
+
+private:
+ unique_sqlite3 db = NULL;
+};
+