Add Connection helper class
This is intended to make querying a "server" easier by wrapping common functionality into one class.
This commit is contained in:
@ -156,6 +156,14 @@ public:
|
||||
return open_conn(rwsplit_port[m], IP[m], user_name, password, ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a readwritesplit Connection
|
||||
*/
|
||||
Connection rwsplit(int m = 0)
|
||||
{
|
||||
return Connection(IP[m], rwsplit_port[m], user_name, password, "test", ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief OpenReadMasterConn Opens new connections to ReadConn master and returns MYSQL struct
|
||||
* To close connection mysql_close() have to be called
|
||||
@ -167,6 +175,14 @@ public:
|
||||
password, ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a readconnroute master Connection
|
||||
*/
|
||||
Connection readconn_master(int m = 0)
|
||||
{
|
||||
return Connection(IP[m], readconn_master_port[m], user_name, password, "test", ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief OpenReadSlaveConn Opens new connections to ReadConn slave and returns MYSQL struct
|
||||
* To close connection mysql_close() have to be called
|
||||
@ -178,6 +194,14 @@ public:
|
||||
password, ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a readconnroute slave Connection
|
||||
*/
|
||||
Connection readconn_slave(int m = 0)
|
||||
{
|
||||
return Connection(IP[m], readconn_slave_port[m], user_name, password, "test", ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CloseRWSplit Closes RWplit connections stored in maxscales->conn_rwsplit[0]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user