diff options
Diffstat (limited to 'frontend/DB.h')
-rw-r--r-- | frontend/DB.h | 18 |
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; +}; + |