libdballe  7.29
Public Member Functions | Protected Member Functions | List of all members
dballe::db::v7::DataCommon< Traits > Class Template Referenceabstract
Inheritance diagram for dballe::db::v7::DataCommon< Traits >:
dballe::db::v7::mysql::MySQLDataCommon< Traits > dballe::db::v7::postgresql::PostgreSQLDataCommon< Traits > dballe::db::v7::sqlite::SQLiteDataCommon< Traits >

Public Member Functions

virtual void read_attrs (int id_data, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
 Load from the database all the attributes for var. More...
 
void merge_attrs (int id_data, const Values &attrs)
 Merge the given attributes with the existing attributes of the given variable: More...
 
void remove_attrs (int data_id, const db::AttrList &attrs)
 Remove the given attributes from the given variable, if they exist.
 
virtual void insert (dballe::db::v7::Transaction &t, typename Traits::BulkVars &vars, bulk::UpdateMode update_mode=bulk::UPDATE, bool with_attrs=false)=0
 Bulk variable insert.
 
virtual void remove (const v7::IdQueryBuilder &qb)=0
 Run the query to delete all records selected by the given QueryBuilder.
 
virtual void dump (FILE *out)=0
 Dump the entire contents of the table to an output stream.
 

Protected Member Functions

void read_attrs_into_values (int id_data, Values &values)
 Load attributes from the database into a Values.
 
virtual void write_attrs (int id_data, const Values &values)=0
 Replace the attributes of a variable with those in Values.
 
virtual void remove_all_attrs (int id_data)=0
 Remove all attributes from a variable.
 

Member Function Documentation

template<typename Traits>
void dballe::db::v7::DataCommon< Traits >::merge_attrs ( int  id_data,
const Values attrs 
)

Merge the given attributes with the existing attributes of the given variable:

  • Existing attributes not in attrs are preserved.
  • Existing attributes in attrs are overwritten.
  • New attributes in attrs are inesrted.
template<typename Traits>
virtual void dballe::db::v7::DataCommon< Traits >::read_attrs ( int  id_data,
std::function< void(std::unique_ptr< wreport::Var >)>  dest 
)
pure virtual

The documentation for this class was generated from the following file: