-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDatabaseHelper.hpp
52 lines (37 loc) · 1.55 KB
/
DatabaseHelper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <nlohmann/json.hpp>
#include <range/v3/all.hpp>
#include <sqlite3.h>
#include <vector>
class Database {
private:
sqlite3* db;
public:
Database();
~Database();
void create_table();
std::vector<std::string> read_column_text(std::string query);
std::vector<std::string> read_column_text_query(std::string table_name,
std::string column_name);
std::vector<std::string>
read_column_text_query_where(std::string table_name,
std::string column_name,
std::string where_column_name,
std::string where_value);
nlohmann::json select_delphimodel_row(std::string modelId);
nlohmann::json select_causemosasyncexperimentresult_row(std::string modelId);
void insert(std::string insert_query);
void insert_into_delphimodel(std::string id, std::string model);
void insert_into_causemosasyncexperimentresult(std::string id,
std::string status,
std::string experimentType,
std::string results);
void update_row(std::string table_name,
std::string column_name,
std::string value,
std::string where_column_name,
std::string where_value);
void delete_rows(std::string table_name,
std::string where_column_name,
std::string where_value);
};