#include <mysql_connector.h>
Public Member Functions | |
void | create (string host, string user, string passwd, string db) |
The base function for the constructor. | |
void | query (string sql_query) |
Sends a query to the server. | |
void | get_data (bool store_local_copy, Vector *v) |
Puts the result of a single field query into a Vector. | |
void | get_time_series (TimeSeries &ts, bool get_returns) |
Puts the results of an time series sql query into a distributed TimeSeries. | |
Private Attributes | |
MYSQL | mysql |
MYSQL_RES * | mysql_result |
int | core_id |
int | num_cores |
int | num_fields |
int | num_local_fields |
int | num_rows |
int | num_local_rows |
void MySQL_Connector::create | ( | string | host, | |
string | user, | |||
string | passwd, | |||
string | db | |||
) |
The base function for the constructor.
host | :The host/server name. | |
user | :The user name. | |
passwd | :The user's password. | |
db | :The database name. |
void MySQL_Connector::query | ( | string | sql_query | ) |
Sends a query to the server.
sql_query | : Query using mysql syntax. |
void MySQL_Connector::get_data | ( | bool | store_local_copy, | |
Vector * | v | |||
) |
Puts the result of a single field query into a Vector.
store_local_copy | : True stores a copy of the entire query result on each core. | |
d_vec | : The distributed Vector to store the data. |
void MySQL_Connector::get_time_series | ( | TimeSeries & | ts, | |
bool | get_returns | |||
) |
Puts the results of an time series sql query into a distributed TimeSeries.
ts | : An allocated TimeSeries. | |
get_returns | : Computes a return series if true, otherwise gets the raw data. |
MYSQL MySQL_Connector::mysql [private] |
MYSQL_RES* MySQL_Connector::mysql_result [private] |
int MySQL_Connector::core_id [private] |
int MySQL_Connector::num_cores [private] |
int MySQL_Connector::num_fields [private] |
int MySQL_Connector::num_local_fields [private] |
int MySQL_Connector::num_rows [private] |
int MySQL_Connector::num_local_rows [private] |