Possible to load basic data from the database

This commit is contained in:
2025-06-02 22:44:53 +02:00
parent 69f7f625f8
commit 397189c259
15 changed files with 426 additions and 58 deletions

View File

@@ -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;
};