AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ModuleDatabaseConnection Class Reference

#include "ModuleDatabase.h"

Inheritance diagram for ModuleDatabaseConnection:
MySQLConnection

Public Types

typedef ModuleDatabaseStatements Statements
 

Public Member Functions

 ModuleDatabaseConnection (MySQLConnectionInfo &connInfo)
 
 ModuleDatabaseConnection (ProducerConsumerQueue< SQLOperation * > *q, MySQLConnectionInfo &connInfo)
 
 ~ModuleDatabaseConnection () override
 
void DoPrepareStatements () override
 
- Public Member Functions inherited from MySQLConnection
 MySQLConnection (MySQLConnectionInfo &connInfo)
 
 MySQLConnection (ProducerConsumerQueue< SQLOperation * > *queue, MySQLConnectionInfo &connInfo)
 Constructor for synchronous connections.
 
virtual ~MySQLConnection ()
 Constructor for asynchronous connections.
 
virtual uint32 Open ()
 
void Close ()
 
bool PrepareStatements ()
 
bool Execute (std::string_view sql)
 
bool Execute (PreparedStatementBase *stmt)
 
ResultSetQuery (std::string_view sql)
 
PreparedResultSetQuery (PreparedStatementBase *stmt)
 
bool _Query (std::string_view sql, MySQLResult **pResult, MySQLField **pFields, uint64 *pRowCount, uint32 *pFieldCount)
 
bool _Query (PreparedStatementBase *stmt, MySQLPreparedStatement **mysqlStmt, MySQLResult **pResult, uint64 *pRowCount, uint32 *pFieldCount)
 
void BeginTransaction ()
 
void RollbackTransaction ()
 
void CommitTransaction ()
 
int ExecuteTransaction (std::shared_ptr< TransactionBase > transaction)
 
size_t EscapeString (char *to, const char *from, size_t length)
 
void Ping ()
 
uint32 GetLastError ()
 

Additional Inherited Members

- Protected Types inherited from MySQLConnection
typedef std::vector< std::unique_ptr< MySQLPreparedStatement > > PreparedStatementContainer
 
- Protected Member Functions inherited from MySQLConnection
bool LockIfReady ()
 
void Unlock ()
 Called by parent databasepool. Will let other threads access this connection.
 
uint32 GetServerVersion () const
 
MySQLPreparedStatementGetPreparedStatement (uint32 index)
 
void PrepareStatement (uint32 index, std::string_view sql, ConnectionFlags flags)
 
virtual void DoPrepareStatements ()=0
 
virtual bool _HandleMySQLErrno (uint32 errNo, uint8 attempts=5)
 
- Protected Attributes inherited from MySQLConnection
PreparedStatementContainer m_stmts
 
bool m_reconnecting
 PreparedStatements storage.
 
bool m_prepareError
 Are we reconnecting?
 
MySQLHandlem_Mysql
 Was there any error while preparing statements?
 

Detailed Description

Member Typedef Documentation

◆ Statements

Constructor & Destructor Documentation

◆ ModuleDatabaseConnection() [1/2]

ModuleDatabaseConnection::ModuleDatabaseConnection ( MySQLConnectionInfo connInfo)
27 : MySQLConnection(connInfo)
28{
29}
Definition: MySQLConnection.h:56

◆ ModuleDatabaseConnection() [2/2]

ModuleDatabaseConnection::ModuleDatabaseConnection ( ProducerConsumerQueue< SQLOperation * > *  q,
MySQLConnectionInfo connInfo 
)
31 : MySQLConnection(q, connInfo)
32{
33}

◆ ~ModuleDatabaseConnection()

ModuleDatabaseConnection::~ModuleDatabaseConnection ( )
override
36{
37}

Member Function Documentation

◆ DoPrepareStatements()

void ModuleDatabaseConnection::DoPrepareStatements ( )
overridevirtual

Implements MySQLConnection.

22{
23 if (!m_reconnecting)
25}
@ MAX_MODULEDATABASE_STATEMENTS
Definition: ModuleDatabase.h:31
PreparedStatementContainer m_stmts
Definition: MySQLConnection.h:105
bool m_reconnecting
PreparedStatements storage.
Definition: MySQLConnection.h:106

References MySQLConnection::m_reconnecting, MySQLConnection::m_stmts, and MAX_MODULEDATABASE_STATEMENTS.