libdballe 5.10
Public Member Functions | Data Fields
dballe::db::Data Struct Reference

Precompiled query to manipulate the data table. More...

#include <data.h>

Public Member Functions

 Data (Connection &conn)
void set (const wreport::Var &var)
 Set the value input fields using a wreport::Var.
void set_value (const char *value)
 Set the value input fields using a string value.
void insert_or_fail ()
 Insert an entry into the data table, failing on conflicts.
bool insert_or_ignore ()
 Insert an entry into the data table, ignoring conflicts.
void insert_or_overwrite ()
 Insert an entry into the data table, overwriting on conflicts.
void dump (FILE *out)
 Dump the entire contents of the table to an output stream.

Data Fields

db::Connectionconn
 DB connection.
db::Statementistm
 Precompiled insert statement.
db::Statementustm
 Precompiled update statement.
db::Statementiistm
 Precompiled insert or ignore statement.
DBALLE_SQL_C_SINT_TYPE id_context
 Context ID SQL parameter.
wreport::Varcode id_var
 Variable type SQL parameter.
char value [255]
 Variable value SQL parameter.
SQLLEN value_ind
 Variable value indicator.

Detailed Description

Precompiled query to manipulate the data table.


Member Function Documentation

void dballe::db::Data::insert_or_fail ( )

Insert an entry into the data table, failing on conflicts.

Trying to replace an existing value will result in an error.

bool dballe::db::Data::insert_or_ignore ( )

Insert an entry into the data table, ignoring conflicts.

Trying to replace an existing value will do nothing.

Returns:
true if it was inserted, false if it was already present
void dballe::db::Data::insert_or_overwrite ( )

Insert an entry into the data table, overwriting on conflicts.

An existing data with the same context and ::dba_varcode will be overwritten.


Field Documentation

DB connection.


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