kima2/src/core/database.h

26 lines
486 B
C
Raw Normal View History

2018-07-06 13:30:23 +02:00
#ifndef DATABASE_H
#define DATABASE_H
#include <string>
#include <sqlite3.h>
class Database
{
public:
Database(const std::string& dbname);
~Database();
Database(const Database&) = delete;
Database& operator=(const Database&) = delete;
void exec(const std::string& sql);
2018-07-10 14:12:37 +02:00
void init();
2018-07-06 13:30:23 +02:00
private:
2018-07-10 14:12:37 +02:00
sqlite3 *db_;
2018-07-11 09:43:40 +02:00
std::string dbname_;
2018-07-09 21:03:59 +02:00
void beginTransaction();
void endTransaction();
2018-07-11 09:43:40 +02:00
void createNew();
int getVersion();
2018-07-06 13:30:23 +02:00
};
#endif // DATABASE_H