Possible to load basic data from the database
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include <string>
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
class Database {
|
||||
|
||||
public:
|
||||
@@ -14,7 +15,18 @@ public:
|
||||
bool exec(const char* sqlQuery);
|
||||
bool exec(const std::string& sqlQuery);
|
||||
|
||||
/// returns true if the sql statment returns at least one row
|
||||
std::optional<int64_t> getInt(const char* sql);
|
||||
|
||||
std::optional<int64_t> insert(const char* sql);
|
||||
|
||||
std::set<std::string> getStrSet(const std::string& sql);
|
||||
|
||||
std::map<std::string, std::string> Database::getStrMap(const std::string& sql);
|
||||
|
||||
private:
|
||||
sqlite3_stmt* prepareStmt(const std::string& sql);
|
||||
|
||||
sqlite3* m_db;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user