Public Member Functions | Data Fields | Private Member Functions | Private Attributes

MySQLService Class Reference

Inherits SQL::Provider.

Collaboration diagram for MySQLService:
Collaboration graph
[legend]

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< QueryCreateTable (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

Detailed Description

A MySQL connection, there can be multiple

Definition at line 97 of file m_mysql.cpp.


Constructor & Destructor Documentation

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 (  ) 

Member Function Documentation

Query MySQLService::BuildInsert ( const Anope::string table,
unsigned int  id,
Data data 
) [virtual]
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]
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]

Implements SQL::Provider.

Definition at line 494 of file m_mysql.cpp.

References stringify().

Query MySQLService::GetTables ( const Anope::string prefix  )  [virtual]

Implements SQL::Provider.

Definition at line 439 of file m_mysql.cpp.

void MySQLService::Run ( Interface i,
const Query query 
) [virtual]

Implements SQL::Provider.

Definition at line 323 of file m_mysql.cpp.

References me.

Result MySQLService::RunQuery ( const Query query  )  [virtual]

Field Documentation

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().

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().

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().

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().

Definition at line 103 of file m_mysql.cpp.

Referenced by Connect().


The documentation for this class was generated from the following file: