1#ifndef DBALLE_DB_V7_MYSQL_DATA_H
2#define DBALLE_DB_V7_MYSQL_DATA_H
4#include <dballe/db/v7/data.h>
5#include <dballe/db/v7/cache.h>
14template<
typename Parent>
23 dballe::sql::MySQLStatement* read_attrs_stm =
nullptr;
25 dballe::sql::MySQLStatement* write_attrs_stm =
nullptr;
27 dballe::sql::MySQLStatement* remove_attrs_stm =
nullptr;
29 dballe::sql::MySQLStatement* sstm =
nullptr;
31 dballe::sql::MySQLStatement* istm =
nullptr;
33 dballe::sql::MySQLStatement* ustm =
nullptr;
44 void read_attrs(
Tracer<>& trc,
int id_data, std::function<
void(std::unique_ptr<wreport::Var>)>
dest)
override;
48 void remove_by_id(
Tracer<>& trc,
int id)
override;
60 using MySQLDataCommon::MySQLDataCommon;
68 void clear_cache()
override {}
77 using MySQLDataCommon::MySQLDataCommon;
86 void clear_cache()
override {}
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition db/v7/fwd.h:46
Definition db/v7/mysql/data.h:16
dballe::sql::MySQLConnection & conn
DB connection.
Definition db/v7/mysql/data.h:19
Precompiled query to manipulate the data table.
Definition db/v7/mysql/data.h:75
void run_summary_query(Tracer<> &trc, const v7::SummaryQueryBuilder &qb, std::function< void(const dballe::DBStation &station, int id_levtr, wreport::Varcode code, const DatetimeRange &datetime, size_t size)>) override
Run a summary query, iterating on the resulting variables.
void query(Tracer<> &trc, int id_station, const Datetime &datetime, std::function< void(int id, int id_levtr, wreport::Varcode code)> dest) override
Query contents of the data table.
void run_data_query(Tracer<> &trc, const v7::DataQueryBuilder &qb, std::function< void(const dballe::DBStation &station, int id_levtr, const Datetime &datetime, int id_data, std::unique_ptr< wreport::Var > var)>) override
Run a data query, iterating on the resulting variables.
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
void insert(Tracer<> &trc, int id_station, const Datetime &datetime, std::vector< batch::MeasuredDatum > &vars, bool with_attrs) override
Bulk variable insert.
Precompiled query to manipulate the station data table.
Definition db/v7/mysql/data.h:58
void insert(Tracer<> &trc, int id_station, std::vector< batch::StationDatum > &vars, bool with_attrs) override
Bulk variable insert.
void query(Tracer<> &trc, int id_station, std::function< void(int id, wreport::Varcode code)> dest) override
Query contents of the data table.
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
void run_station_data_query(Tracer<> &trc, const v7::DataQueryBuilder &qb, std::function< void(const dballe::DBStation &station, int id_data, std::unique_ptr< wreport::Var > var)>) override
Run a station data query, iterating on the resulting variables.
Database connection.
Definition mysql.h:127
Forward declarations for public dballe/sql names.
Range of datetimes.
Definition types.h:295
Date and time.
Definition types.h:165
Collection of Value objects, indexed by wreport::Varcode.
Definition values.h:177
Definition qbuilder.h:116
Definition qbuilder.h:125
Definition transaction.h:16