TrinityCore
Loading...
Searching...
No Matches
WorldDatabaseConnection Class Reference

#include <WorldDatabase.h>

+ Inheritance diagram for WorldDatabaseConnection:

Public Types

typedef WorldDatabaseStatements Statements
 

Public Member Functions

 WorldDatabaseConnection (MySQLConnectionInfo &connInfo, ConnectionFlags connectionFlags)
 
 ~WorldDatabaseConnection ()
 
void DoPrepareStatements () override
 
- Public Member Functions inherited from MySQLConnection
 MySQLConnection (MySQLConnectionInfo &connInfo, ConnectionFlags connectionFlags)
 
virtual ~MySQLConnection ()
 
uint32 Open ()
 
void Close ()
 
bool PrepareStatements ()
 
bool Execute (char const *sql)
 
bool Execute (PreparedStatementBase *stmt)
 
ResultSet * Query (char const *sql)
 
PreparedResultSet * Query (PreparedStatementBase *stmt)
 
bool _Query (char const *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 ()
 
void StartWorkerThread (Trinity::Asio::IoContext *context)
 
std::thread::id GetWorkerThreadId () const
 

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
 
MySQLPreparedStatement * GetPreparedStatement (uint32 index)
 
void PrepareStatement (uint32 index, std::string_view sql, ConnectionFlags flags)
 
- Protected Attributes inherited from MySQLConnection
PreparedStatementContainer m_stmts
 PreparedStatements storage.
 
bool m_reconnecting
 Are we reconnecting?
 
bool m_prepareError
 Was there any error while preparing statements?
 

Detailed Description

Definition at line 93 of file WorldDatabase.h.

Member Typedef Documentation

◆ Statements

Constructor & Destructor Documentation

◆ WorldDatabaseConnection()

WorldDatabaseConnection::WorldDatabaseConnection ( MySQLConnectionInfo &  connInfo,
ConnectionFlags  connectionFlags 
)

Definition at line 85 of file WorldDatabase.cpp.

◆ ~WorldDatabaseConnection()

WorldDatabaseConnection::~WorldDatabaseConnection ( )

Definition at line 89 of file WorldDatabase.cpp.

Member Function Documentation

◆ DoPrepareStatements()

void WorldDatabaseConnection::DoPrepareStatements ( )
overridevirtual

Implements MySQLConnection.

Definition at line 21 of file WorldDatabase.cpp.

References CONNECTION_ASYNC, CONNECTION_SYNCH, MySQLConnection::m_reconnecting, MySQLConnection::m_stmts, MAX_WORLDDATABASE_STATEMENTS, MySQLConnection::PrepareStatement(), WORLD_DEL_CREATURE, WORLD_DEL_CREATURE_ADDON, WORLD_DEL_DISABLES, WORLD_DEL_EVENT_GAMEOBJECT, WORLD_DEL_GAME_EVENT_CREATURE, WORLD_DEL_GAME_EVENT_MODEL_EQUIP, WORLD_DEL_GAME_TELE, WORLD_DEL_GAMEOBJECT, WORLD_DEL_GAMEOBJECT_ADDON, WORLD_DEL_GRAVEYARD_ZONE, WORLD_DEL_LINKED_RESPAWN, WORLD_DEL_LINKED_RESPAWN_MASTER, WORLD_DEL_NPC_VENDOR, WORLD_DEL_SPAWNGROUP_MEMBER, WORLD_DEL_WAYPOINT_PATH_NODE, WORLD_INS_CONDITION, WORLD_INS_CREATURE, WORLD_INS_CREATURE_ADDON, WORLD_INS_CREATURE_FORMATION, WORLD_INS_DISABLES, WORLD_INS_GAME_TELE, WORLD_INS_GAMEOBJECT, WORLD_INS_GRAVEYARD_ZONE, WORLD_INS_NPC_VENDOR, WORLD_INS_WAYPOINT_PATH, WORLD_INS_WAYPOINT_PATH_NODE, WORLD_REP_LINKED_RESPAWN, WORLD_SEL_COMMANDS, WORLD_SEL_CREATURE_ADDON_BY_GUID, WORLD_SEL_CREATURE_BY_ID, WORLD_SEL_CREATURE_NEAREST, WORLD_SEL_CREATURE_TEMPLATE, WORLD_SEL_CREATURE_TEXT, WORLD_SEL_DISABLES, WORLD_SEL_GAMEOBJECT_NEAREST, WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS, WORLD_SEL_NPC_VENDOR_REF, WORLD_SEL_SMART_SCRIPTS, WORLD_SEL_WAYPOINT_PATH, WORLD_SEL_WAYPOINT_PATH_NODE, WORLD_SEL_WAYPOINT_PATH_NODE_BY_POS, WORLD_SEL_WAYPOINT_PATH_NODE_MAX_NODEID, WORLD_SEL_WAYPOINT_PATH_NODE_MAX_PATHID, WORLD_SEL_WAYPOINT_PATH_NODE_POS_BY_PATHID, WORLD_SEL_WAYPOINT_PATH_NODE_POS_FIRST_BY_PATHID, WORLD_SEL_WAYPOINT_PATH_NODE_POS_LAST_BY_PATHID, WORLD_UPD_CREATURE_ADDON_PATH, WORLD_UPD_CREATURE_FACTION, WORLD_UPD_CREATURE_MOVEMENT_TYPE, WORLD_UPD_CREATURE_NPCFLAG, WORLD_UPD_CREATURE_POSITION, WORLD_UPD_CREATURE_SPAWN_TIME_SECS, WORLD_UPD_CREATURE_WANDER_DISTANCE, WORLD_UPD_CREATURE_ZONE_AREA_DATA, WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA, WORLD_UPD_WAYPOINT_PATH_NODE, and WORLD_UPD_WAYPOINT_PATH_NODE_POSITION.


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