1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-23 05:07:46 +00:00
sapphire/deps/mysqlConnector/MySqlBase.cpp

32 lines
1.1 KiB
C++
Raw Normal View History

#include "MySqlBase.h"
#include "Connection.h"
#include <memory>
2018-10-26 19:12:55 +02:00
#include <mysql.h>
Mysql::MySqlBase::MySqlBase()
{
}
Mysql::MySqlBase::~MySqlBase()
{
}
std::string Mysql::MySqlBase::getVersionInfo()
{
return std::string( mysql_get_client_info() );
}
std::shared_ptr< Mysql::Connection > Mysql::MySqlBase::connect( const std::string& hostName, const std::string& userName,
const std::string& password, uint16_t port = 3306 )
{
return std::make_shared< Mysql::Connection >( shared_from_this(), hostName, userName, password, port );
}
std::shared_ptr< Mysql::Connection > Mysql::MySqlBase::connect( const std::string& hostName, const std::string& userName,
const std::string& password, const optionMap& options,
uint16_t port = 3306 )
{
return std::shared_ptr< Mysql::Connection >( new Mysql::Connection( shared_from_this(), hostName, userName, password, options, port ) );
}