/usr/include/dballe/db/v7/postgresql/data.h is in libdballe-dev 7.21-1.
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 | #ifndef DBALLE_DB_V7_POSTGRESQL_DATA_H
#define DBALLE_DB_V7_POSTGRESQL_DATA_H
#include <dballe/db/v7/data.h>
#include <dballe/sql/fwd.h>
namespace dballe {
struct Record;
namespace db {
namespace v7 {
namespace postgresql {
struct DB;
template<typename Traits>
class PostgreSQLDataCommon : public DataCommon<Traits>
{
protected:
/// DB connection
dballe::sql::PostgreSQLConnection& conn;
std::string select_attrs_query_name;
std::string write_attrs_query_name;
std::string remove_attrs_query_name;
std::string remove_data_query_name;
public:
PostgreSQLDataCommon(dballe::sql::PostgreSQLConnection& conn);
PostgreSQLDataCommon(const PostgreSQLDataCommon&) = delete;
PostgreSQLDataCommon(const PostgreSQLDataCommon&&) = delete;
PostgreSQLDataCommon& operator=(const PostgreSQLDataCommon&) = delete;
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 PostgreSQLDataCommon<StationDataTraits>;
extern template class PostgreSQLDataCommon<DataTraits>;
class PostgreSQLStationData : public PostgreSQLDataCommon<StationDataTraits>
{
public:
using PostgreSQLDataCommon::PostgreSQLDataCommon;
PostgreSQLStationData(dballe::sql::PostgreSQLConnection& 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;
};
class PostgreSQLData : public PostgreSQLDataCommon<DataTraits>
{
public:
using PostgreSQLDataCommon::PostgreSQLDataCommon;
PostgreSQLData(dballe::sql::PostgreSQLConnection& 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
|