38 #ifndef DATABASESERVER_DATAMODEL_SQLITEWRAPPER_H 39 #define DATABASESERVER_DATAMODEL_SQLITEWRAPPER_H 43 #include "src/database-server/data-source/idatasource.h" 106 const std::string& var_name,
118 const std::string& var_name,
Err create_scheme() noexceptoverride
create_scheme creates the database schema for sqlite3
Definition: sqlitewrapper.cc:66
VarValue(Variable &&variable, double &&val, std::uint64_t &&ts)
Definition: varvalue.cc:45
Definition: variable.h:44
Err
Definition: idatasource.h:57
SQLiteWrapper(const std::string &db_path)
SQLiteWrapper create a sqlite3 connection.
Definition: sqlitewrapper.cc:53
~SQLiteWrapper() override
~SQLiteWrapper release the sqlite3 connection.
Definition: sqlitewrapper.cc:64
Err add_variable_value(const VarValue &var) noexceptoverride
add_variable_value add an entry ti the vriable value table, related to an entry in the variable table...
Definition: sqlitewrapper.cc:113
virtual Err count_variable_values(const std::string &var_name, const std::chrono::system_clock::time_point &start_date, const std::chrono::system_clock::time_point &end_date, const std::function< void(size_t count)> &send_count) noexceptoverride
count_variable_values count the number of values for a given variable in a date range.
Definition: sqlitewrapper.cc:342
Err fetch_variables(const std::function< void(const Variable &var, size_t index)> &send_vale) noexceptoverride
fetch_variables get all variables.
Definition: sqlitewrapper.cc:131
Err fetch_variable_values(const std::string &var_name, const std::function< void(const VarValue &, size_t index)> &send_vale) noexceptoverride
fetch_variable_values get all values related to a variable.
virtual Err count_variable_values(const std::string &var_name, const std::chrono::system_clock::time_point &start_date, const std::chrono::system_clock::time_point &end_date, const std::function< void(size_t count)> &send_count) noexcept=0
count_variable_values count all values of a given variable
Err count_variable_values(const std::string &var_name, const std::function< void(size_t count)> &send_count) noexceptoverride
count_variable_values count the number of values for a given variable.
Definition: sqlitewrapper.cc:235
Err add_variable(const Variable &var) noexceptoverride
add_variable add an entry to the variable table.
Definition: sqlitewrapper.cc:98
sqlite3 * db_
Definition: sqlitewrapper.h:153