Anope IRC Services  Version 2.0
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
MySQLService Class Reference
Inheritance diagram for MySQLService:
Inheritance graph
[legend]
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)
 
- Public Member Functions inherited from SQL::Provider
 Provider (Module *c, const Anope::string &n)
 
- Public Member Functions inherited from Service
 Service (Module *o, const Anope::string &t, const Anope::string &n)
 
virtual ~Service ()
 
void Register ()
 
void Unregister ()
 
- Public Member Functions inherited from Base
 Base ()
 
virtual ~Base ()
 
void AddReference (ReferenceBase *r)
 
void DelReference (ReferenceBase *r)
 

Data Fields

Mutex Lock
 
- Data Fields inherited from Service
Moduleowner
 
Anope::string type
 
Anope::string name
 

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
 

Additional Inherited Members

- Static Public Member Functions inherited from Service
static ServiceFindService (const Anope::string &t, const Anope::string &n)
 
static std::vector< Anope::stringGetServiceKeys (const Anope::string &t)
 
static void AddAlias (const Anope::string &t, const Anope::string &n, const Anope::string &v)
 
static void DelAlias (const Anope::string &t, const Anope::string &n)
 

Detailed Description

A MySQL connection, there can be multiple

Definition at line 102 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 294 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 492 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 468 of file m_mysql.cpp.

References Connect(), and sql.

Referenced by RunQuery().

void MySQLService::Connect ( )

Definition at line 452 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 485 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 502 of file m_mysql.cpp.

References stringify().

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

Implements SQL::Provider.

Definition at line 447 of file m_mysql.cpp.

void MySQLService::Run ( Interface i,
const Query query 
)
virtual
Result MySQLService::RunQuery ( const Query query)
virtual

Field Documentation

std::map<Anope::string, std::set<Anope::string> > MySQLService::active_schema
private

Definition at line 104 of file m_mysql.cpp.

Referenced by BuildInsert(), and CreateTable().

Anope::string MySQLService::database
private

Definition at line 106 of file m_mysql.cpp.

Referenced by Connect().

Mutex MySQLService::Lock

Definition at line 124 of file m_mysql.cpp.

Referenced by ModuleSQL::OnModuleUnload(), RunQuery(), and ~MySQLService().

Anope::string MySQLService::password
private

Definition at line 109 of file m_mysql.cpp.

Referenced by Connect().

int MySQLService::port
private

Definition at line 110 of file m_mysql.cpp.

Referenced by Connect().

Anope::string MySQLService::server
private

Definition at line 107 of file m_mysql.cpp.

Referenced by Connect().

MYSQL* MySQLService::sql
private

Definition at line 112 of file m_mysql.cpp.

Referenced by CheckConnection(), Connect(), Escape(), RunQuery(), and ~MySQLService().

Anope::string MySQLService::user
private

Definition at line 108 of file m_mysql.cpp.

Referenced by Connect().


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