2017-09-14 18:39:12 +02:00
|
|
|
#ifndef SAPPHIRE_MYSQLBASE_H
|
|
|
|
#define SAPPHIRE_MYSQLBASE_H
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <mysql.h>
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace Core
|
|
|
|
{
|
|
|
|
namespace Db
|
|
|
|
{
|
|
|
|
|
|
|
|
typedef std::map< enum mysql_option, std::string > optionMap;
|
|
|
|
|
|
|
|
class Connection;
|
|
|
|
|
|
|
|
class MySqlBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MySqlBase();
|
|
|
|
|
|
|
|
~MySqlBase();
|
|
|
|
|
|
|
|
Connection * connect( const std::string& hostName, const std::string& userName, const std::string& password );
|
|
|
|
Connection * connect( const std::string& hostName, const std::string& userName, const std::string& password, const optionMap& map );
|
|
|
|
|
|
|
|
std::string getVersionInfo();
|
|
|
|
|
|
|
|
private:
|
2017-09-19 00:02:14 +02:00
|
|
|
MySqlBase( const MySqlBase& );
|
|
|
|
void operator=( MySqlBase& );
|
2017-09-14 18:39:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SAPPHIRE_MYSQLBASE_H
|