/usr/include/dballe/db/v7/mysql/data.h is in libdballe-dev 7.21-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | #ifndef DBALLE_DB_V7_MYSQL_DATA_H
#define DBALLE_DB_V7_MYSQL_DATA_H
#include <dballe/db/v7/data.h>
#include <dballe/sql/fwd.h>
namespace dballe {
struct Record;
namespace db {
namespace v7 {
namespace mysql {
struct DB;
template<typename Traits>
class MySQLDataCommon : public DataCommon<Traits>
{
protected:
/// DB connection
dballe::sql::MySQLConnection& conn;
#if 0
/// Precompiled read attributes statement
dballe::sql::MySQLStatement* read_attrs_stm = nullptr;
/// Precompiled write attributes statement
dballe::sql::MySQLStatement* write_attrs_stm = nullptr;
/// Precompiled remove attributes statement
dballe::sql::MySQLStatement* remove_attrs_stm = nullptr;
/// Precompiled select statement
dballe::sql::MySQLStatement* sstm = nullptr;
/// Precompiled insert statement
dballe::sql::MySQLStatement* istm = nullptr;
/// Precompiled update statement
dballe::sql::MySQLStatement* ustm = nullptr;
#endif
public:
MySQLDataCommon(dballe::sql::MySQLConnection& conn);
MySQLDataCommon(const MySQLDataCommon&) = delete;
MySQLDataCommon(const MySQLDataCommon&&) = delete;
MySQLDataCommon& operator=(const MySQLDataCommon&) = delete;
~MySQLDataCommon();
void read_attrs(int id_data, std::function<void(std::unique_ptr<wreport::Var>)> dest) override;
void write_attrs(int id_data, const Values& values) override;
void remove_all_attrs(int id_data) override;
void remove(const v7::IdQueryBuilder& qb) override;
};
extern template class MySQLDataCommon<StationDataTraits>;
extern template class MySQLDataCommon<DataTraits>;
/**
* Precompiled query to manipulate the station data table
*/
class MySQLStationData : public MySQLDataCommon<StationDataTraits>
{
public:
using MySQLDataCommon::MySQLDataCommon;
MySQLStationData(dballe::sql::MySQLConnection& conn);
void insert(dballe::db::v7::Transaction& t, v7::bulk::InsertStationVars& vars, bulk::UpdateMode update_mode=bulk::UPDATE, bool with_attrs=false) override;
void dump(FILE* out) override;
};
/**
* Precompiled query to manipulate the data table
*/
class MySQLData : public MySQLDataCommon<DataTraits>
{
public:
using MySQLDataCommon::MySQLDataCommon;
MySQLData(dballe::sql::MySQLConnection& conn);
void insert(dballe::db::v7::Transaction& t, v7::bulk::InsertVars& vars, bulk::UpdateMode update_mode=bulk::UPDATE, bool with_attrs=false) override;
void dump(FILE* out) override;
};
}
}
}
}
#endif
|