/usr/include/dballe/db/v7/sqlite/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 | #ifndef DBALLE_DB_V7_SQLITE_DATA_H
#define DBALLE_DB_V7_SQLITE_DATA_H
#include <dballe/db/v7/data.h>
#include <dballe/sql/fwd.h>
namespace dballe {
struct Record;
namespace db {
namespace v7 {
namespace sqlite {
struct DB;
template<typename Traits>
class SQLiteDataCommon : public DataCommon<Traits>
{
protected:
/// DB connection
dballe::sql::SQLiteConnection& conn;
/// Precompiled read attributes statement
dballe::sql::SQLiteStatement* read_attrs_stm = nullptr;
/// Precompiled write attributes statement
dballe::sql::SQLiteStatement* write_attrs_stm = nullptr;
/// Precompiled remove attributes statement
dballe::sql::SQLiteStatement* remove_attrs_stm = nullptr;
/// Precompiled select statement
dballe::sql::SQLiteStatement* sstm = nullptr;
/// Precompiled insert statement
dballe::sql::SQLiteStatement* istm = nullptr;
/// Precompiled update statement
dballe::sql::SQLiteStatement* ustm = nullptr;
public:
SQLiteDataCommon(dballe::sql::SQLiteConnection& conn);
SQLiteDataCommon(const SQLiteDataCommon&) = delete;
SQLiteDataCommon(const SQLiteDataCommon&&) = delete;
SQLiteDataCommon& operator=(const SQLiteDataCommon&) = delete;
~SQLiteDataCommon();
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 SQLiteDataCommon<StationDataTraits>;
extern template class SQLiteDataCommon<DataTraits>;
/**
* Precompiled query to manipulate the station data table
*/
class SQLiteStationData : public SQLiteDataCommon<StationDataTraits>
{
public:
using SQLiteDataCommon::SQLiteDataCommon;
SQLiteStationData(dballe::sql::SQLiteConnection& 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 SQLiteData : public SQLiteDataCommon<DataTraits>
{
public:
using SQLiteDataCommon::SQLiteDataCommon;
SQLiteData(dballe::sql::SQLiteConnection& 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
|