2018-10-24 23:31:26 +11:00
|
|
|
#ifndef SAPPHIRE_MYSQLBASE_H
|
|
|
|
#define SAPPHIRE_MYSQLBASE_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
2018-10-26 23:07:55 +02:00
|
|
|
#include "MysqlCommon.h"
|
2018-10-24 23:31:26 +11:00
|
|
|
|
2018-10-26 19:12:55 +02:00
|
|
|
|
2018-10-24 23:31:26 +11:00
|
|
|
namespace Mysql
|
|
|
|
{
|
|
|
|
|
2018-10-26 23:07:55 +02:00
|
|
|
using optionMap = std::map< enum mysqlOption, std::string >;
|
2018-10-24 23:31:26 +11:00
|
|
|
|
|
|
|
class Connection;
|
|
|
|
|
|
|
|
class MySqlBase : public std::enable_shared_from_this< MySqlBase >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MySqlBase();
|
|
|
|
|
|
|
|
~MySqlBase();
|
|
|
|
|
|
|
|
std::shared_ptr< Connection > connect( const std::string& hostName, const std::string& userName,
|
|
|
|
const std::string& password, uint16_t port );
|
|
|
|
std::shared_ptr< Connection > connect( const std::string& hostName, const std::string& userName,
|
|
|
|
const std::string& password, const optionMap& map, uint16_t port );
|
|
|
|
|
|
|
|
std::string getVersionInfo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
MySqlBase( const MySqlBase& );
|
|
|
|
void operator=( MySqlBase& );
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SAPPHIRE_MYSQLBASE_H
|