19#ifndef LIBMYSQLWRAPPER_H
20#define LIBMYSQLWRAPPER_H
35 #if LIBMYSQL_VERSION_ID > 80001
49 SQL_FIELD(
const std::string& i_param,
const enum_field_types &type,
const unsigned int &i_processing=0);
50 SQL_FIELD(
const std::string& i_str,
const std::string& i_param=
"",
const unsigned int &i_processing=0);
51 SQL_FIELD(
const mio::Date& i_dt,
const std::string& i_param=
"",
const unsigned int &i_processing=0);
80 MYSQL*
initMysql(
const std::string& mysqlhost,
const std::string& mysqluser,
const std::string& mysqlpass,
const std::string& mysqldb,
const unsigned int& options=0);
81 MYSQL_STMT*
initStmt(MYSQL **mysql,
const std::string& query,
const long unsigned int& ref_param_count);
83 void bindParams(MYSQL_STMT **stmt, std::vector<SQL_FIELD> ¶ms_fields);
84 void bindResults(MYSQL_STMT **stmt, std::vector<SQL_FIELD> &result_fields);
Definition: libMysqlWrapper.h:33
void setFromDate(const mio::Date &i_dt, MYSQL_TIME &ts)
Definition: libMysqlWrapper.cc:63
void setString(const std::string &i_str)
Definition: libMysqlWrapper.cc:78
void resetDate()
Definition: libMysqlWrapper.cc:43
bool isDate
for MeteoIO to quickly identify datetime fields
Definition: libMysqlWrapper.h:70
double val
for MySQL to store double data
Definition: libMysqlWrapper.h:67
void reset()
Definition: libMysqlWrapper.cc:54
MYSQL_TIME dt
for MySQL to store datetime data
Definition: libMysqlWrapper.h:64
void setDate(const mio::Date &i_dt)
Definition: libMysqlWrapper.cc:86
unitsConversions
Definition: libMysqlWrapper.h:41
@ CM_TO_M
Definition: libMysqlWrapper.h:44
@ NORMALIZE_PC
Definition: libMysqlWrapper.h:45
@ C_TO_K
Definition: libMysqlWrapper.h:43
@ HPA_TO_PA
Definition: libMysqlWrapper.h:46
@ NONE
Definition: libMysqlWrapper.h:42
BOOL_TYPE is_null
Definition: libMysqlWrapper.h:69
SQL_FIELD(const std::string &i_param, const enum_field_types &type, const unsigned int &i_processing=0)
Definition: libMysqlWrapper.cc:27
my_bool BOOL_TYPE
Definition: libMysqlWrapper.h:38
BOOL_TYPE error
for MySQL ro report a NULL value or errors
Definition: libMysqlWrapper.h:69
mio::Date getDate(const double &TZ) const
Definition: libMysqlWrapper.cc:100
unsigned int processing
what kind of corrections to apply to the raw data (such as C to K conversion, etc
Definition: libMysqlWrapper.h:68
void setDouble(const double &i_val)
Definition: libMysqlWrapper.cc:93
char str[MYSQL_STRING_SIZE]
for MySQL to store string data
Definition: libMysqlWrapper.h:63
unsigned long int str_len
for MySQL, length of a string
Definition: libMysqlWrapper.h:65
std::string param
the parameter name for MeteoIO
Definition: libMysqlWrapper.h:62
unsigned long int buffer_len
for MySQL, allocated data buffer length
Definition: libMysqlWrapper.h:66
enum_field_types MysqlType
for MySQL, data type of the field (see mysql/field_types.h)
Definition: libMysqlWrapper.h:71
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
static const int MYSQL_STRING_SIZE
Definition: libMysqlWrapper.h:31
Definition: libMysqlWrapper.cc:113
void bindParams(MYSQL_STMT **stmt, std::vector< SQL_FIELD > ¶ms_fields)
Definition: libMysqlWrapper.cc:150
void bindResults(MYSQL_STMT **stmt, std::vector< SQL_FIELD > &result_fields)
Definition: libMysqlWrapper.cc:178
MysqlOptions
Definition: libMysqlWrapper.h:75
@ COMPRESSION
Definition: libMysqlWrapper.h:76
@ ENCRYPTION
Definition: libMysqlWrapper.h:77
MYSQL * initMysql(const std::string &mysqlhost, const std::string &mysqluser, const std::string &mysqlpass, const std::string &mysqldb, const unsigned int &options)
Definition: libMysqlWrapper.cc:115
double retrieveData(const SQL_FIELD &field, const unsigned int &conversion)
Definition: libMysqlWrapper.cc:213
MYSQL_STMT * initStmt(MYSQL **mysql, const std::string &query, const long unsigned int &ref_param_count)
Definition: libMysqlWrapper.cc:135