Inherits SQL::Provider.

Public Member Functions | |
| MySQLService (Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, int po) | |
| ~MySQLService () | |
| void | Run (Interface *i, const Query &query) anope_override |
| Result | RunQuery (const Query &query) anope_override |
| std::vector< Query > | CreateTable (const Anope::string &table, const Data &data) anope_override |
| Query | BuildInsert (const Anope::string &table, unsigned int id, Data &data) anope_override |
| Query | GetTables (const Anope::string &prefix) anope_override |
| void | Connect () |
| bool | CheckConnection () |
| Anope::string | BuildQuery (const Query &q) |
| Anope::string | FromUnixtime (time_t) |
Data Fields | |
| Mutex | Lock |
Private Member Functions | |
| Anope::string | Escape (const Anope::string &query) |
Private Attributes | |
| std::map< Anope::string, std::set< Anope::string > > | active_schema |
| Anope::string | database |
| Anope::string | server |
| Anope::string | user |
| Anope::string | password |
| int | port |
| MYSQL * | sql |
A MySQL connection, there can be multiple
Definition at line 97 of file m_mysql.cpp.
| MySQLService::MySQLService | ( | Module * | o, | |
| const Anope::string & | n, | |||
| const Anope::string & | d, | |||
| const Anope::string & | s, | |||
| const Anope::string & | u, | |||
| const Anope::string & | p, | |||
| int | po | |||
| ) |
Definition at line 295 of file m_mysql.cpp.
References Connect().
| MySQLService::~MySQLService | ( | ) |
Definition at line 301 of file m_mysql.cpp.
References Mutex::Lock(), Lock, me, SQL::Interface::OnError(), QueryRequest::query, QueryRequest::service, sql, QueryRequest::sqlinterface, and Mutex::Unlock().
| Query MySQLService::BuildInsert | ( | const Anope::string & | table, | |
| unsigned int | id, | |||
| Data & | data | |||
| ) | [virtual] |
Implements SQL::Provider.
Definition at line 409 of file m_mysql.cpp.
References active_schema, SQL::Data::data, Anope::string::end(), Anope::string::erase(), SQL::Query::SetValue(), and stringify().
| Anope::string MySQLService::BuildQuery | ( | const Query & | q | ) |
Definition at line 484 of file m_mysql.cpp.
References SQL::Query::parameters, SQL::Query::query, and Anope::string::replace_all_cs().
Referenced by RunQuery().
| bool MySQLService::CheckConnection | ( | ) |
Definition at line 460 of file m_mysql.cpp.
References Connect(), and sql.
Referenced by RunQuery().
| void MySQLService::Connect | ( | ) |
Definition at line 444 of file m_mysql.cpp.
References Anope::string::c_str(), database, LOG_DEBUG, Service::name, password, port, server, sql, timeout, and user.
Referenced by CheckConnection(), and MySQLService().
| std::vector< Query > MySQLService::CreateTable | ( | const Anope::string & | table, | |
| const Data & | data | |||
| ) | [virtual] |
Implements SQL::Provider.
Definition at line 353 of file m_mysql.cpp.
References active_schema, SQL::Data::data, SQL::Result::Get(), SQL::Data::GetType(), LOG_DEBUG, Anope::string::push_back(), SQL::Result::Rows(), and RunQuery().
| Anope::string MySQLService::Escape | ( | const Anope::string & | query | ) | [private] |
Escape a query. Note the mutex must be held!
Definition at line 477 of file m_mysql.cpp.
References Anope::string::c_str(), Anope::string::length(), and sql.
| Anope::string MySQLService::FromUnixtime | ( | time_t | t | ) | [virtual] |
| Query MySQLService::GetTables | ( | const Anope::string & | prefix | ) | [virtual] |
Implements SQL::Provider.
Definition at line 439 of file m_mysql.cpp.
Implements SQL::Provider.
Definition at line 331 of file m_mysql.cpp.
References BuildQuery(), Anope::string::c_str(), CheckConnection(), Anope::string::length(), Mutex::Lock(), Lock, sql, and Mutex::Unlock().
Referenced by CreateTable(), and DispatcherThread::Run().
std::map<Anope::string, std::set<Anope::string> > MySQLService::active_schema [private] |
Definition at line 99 of file m_mysql.cpp.
Referenced by BuildInsert(), and CreateTable().
Anope::string MySQLService::database [private] |
Definition at line 101 of file m_mysql.cpp.
Referenced by Connect().
Definition at line 119 of file m_mysql.cpp.
Referenced by ModuleSQL::OnModuleUnload(), RunQuery(), and ~MySQLService().
Anope::string MySQLService::password [private] |
Definition at line 104 of file m_mysql.cpp.
Referenced by Connect().
int MySQLService::port [private] |
Definition at line 105 of file m_mysql.cpp.
Referenced by Connect().
Anope::string MySQLService::server [private] |
Definition at line 102 of file m_mysql.cpp.
Referenced by Connect().
MYSQL* MySQLService::sql [private] |
Definition at line 107 of file m_mysql.cpp.
Referenced by CheckConnection(), Connect(), Escape(), RunQuery(), and ~MySQLService().
Anope::string MySQLService::user [private] |
Definition at line 103 of file m_mysql.cpp.
Referenced by Connect().
1.7.1