aboutsummaryrefslogtreecommitdiff
path: root/frontend/DB.h
blob: b464f9f90338b32f70420a7db4c67f0cd75f194b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
};