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

#include <MySQLPreparedStatement.h>

Public Member Functions

 MySQLPreparedStatement (MySQLStmt *stmt, std::string queryString)
 
 ~MySQLPreparedStatement ()
 
void BindParameters (PreparedStatementBase *stmt)
 
uint32 GetParameterCount () const
 

Protected Member Functions

void SetParameter (uint8 index, std::nullptr_t)
 
void SetParameter (uint8 index, bool value)
 
template<typename T >
void SetParameter (uint8 index, T value)
 
void SetParameter (uint8 index, SystemTimePoint value)
 
void SetParameter (uint8 index, std::string const &value)
 
void SetParameter (uint8 index, std::vector< uint8 > const &value)
 
MySQLStmt * GetSTMT ()
 
MySQLBind * GetBind ()
 
void ClearParameters ()
 
void AssertValidIndex (uint8 index)
 
std::string getQueryString () const
 

Protected Attributes

PreparedStatementBase * m_stmt
 

Private Member Functions

 MySQLPreparedStatement (MySQLPreparedStatement const &right)=delete
 
MySQLPreparedStatement & operator= (MySQLPreparedStatement const &right)=delete
 

Private Attributes

MySQLStmt * m_Mstmt
 
uint32 m_paramCount
 
std::vector< bool > m_paramsSet
 
MySQLBind * m_bind
 
std::string const m_queryString
 

Friends

class MySQLConnection
 
class PreparedStatementBase
 

Detailed Description

Definition at line 33 of file MySQLPreparedStatement.h.

Constructor & Destructor Documentation

◆ MySQLPreparedStatement() [1/2]

MySQLPreparedStatement::MySQLPreparedStatement ( MySQLStmt *  stmt,
std::string  queryString 
)

Initialize variable parameters

"If set to 1, causes mysql_stmt_store_result() to update the metadata MYSQL_FIELD->max_length value."

Definition at line 40 of file MySQLPreparedStatement.cpp.

References m_bind, m_paramCount, and m_paramsSet.

◆ ~MySQLPreparedStatement()

MySQLPreparedStatement::~MySQLPreparedStatement ( )

Definition at line 54 of file MySQLPreparedStatement.cpp.

References ClearParameters(), m_bind, and m_Mstmt.

◆ MySQLPreparedStatement() [2/2]

MySQLPreparedStatement::MySQLPreparedStatement ( MySQLPreparedStatement const &  right)
privatedelete

Member Function Documentation

◆ AssertValidIndex()

void MySQLPreparedStatement::AssertValidIndex ( uint8  index)
protected

◆ BindParameters()

◆ ClearParameters()

void MySQLPreparedStatement::ClearParameters ( )
protected

◆ GetBind()

MySQLBind * MySQLPreparedStatement::GetBind ( )
inlineprotected

Definition at line 56 of file MySQLPreparedStatement.h.

Referenced by MySQLConnection::_Query(), and MySQLConnection::Execute().

◆ GetParameterCount()

uint32 MySQLPreparedStatement::GetParameterCount ( ) const
inline

Definition at line 44 of file MySQLPreparedStatement.h.

◆ getQueryString()

std::string MySQLPreparedStatement::getQueryString ( ) const
protected

◆ GetSTMT()

MySQLStmt * MySQLPreparedStatement::GetSTMT ( )
inlineprotected

◆ operator=()

MySQLPreparedStatement & MySQLPreparedStatement::operator= ( MySQLPreparedStatement const &  right)
privatedelete

◆ SetParameter() [1/6]

void MySQLPreparedStatement::SetParameter ( uint8  index,
bool  value 
)
protected

Definition at line 126 of file MySQLPreparedStatement.cpp.

References SetParameter().

◆ SetParameter() [2/6]

void MySQLPreparedStatement::SetParameter ( uint8  index,
std::nullptr_t   
)
protected

Definition at line 112 of file MySQLPreparedStatement.cpp.

References AssertValidIndex(), m_bind, and m_paramsSet.

Referenced by BindParameters(), and SetParameter().

◆ SetParameter() [3/6]

void MySQLPreparedStatement::SetParameter ( uint8  index,
std::string const &  value 
)
protected

Definition at line 176 of file MySQLPreparedStatement.cpp.

References AssertValidIndex(), m_bind, and m_paramsSet.

◆ SetParameter() [4/6]

void MySQLPreparedStatement::SetParameter ( uint8  index,
std::vector< uint8 > const &  value 
)
protected

Definition at line 193 of file MySQLPreparedStatement.cpp.

References AssertValidIndex(), m_bind, and m_paramsSet.

◆ SetParameter() [5/6]

void MySQLPreparedStatement::SetParameter ( uint8  index,
SystemTimePoint  value 
)
protected

Definition at line 149 of file MySQLPreparedStatement.cpp.

References AssertValidIndex(), m_bind, and m_paramsSet.

◆ SetParameter() [6/6]

template<typename T >
void MySQLPreparedStatement::SetParameter ( uint8  index,
T  value 
)
protected

Definition at line 132 of file MySQLPreparedStatement.cpp.

References AssertValidIndex(), m_bind, and m_paramsSet.

Friends And Related Symbol Documentation

◆ MySQLConnection

friend class MySQLConnection
friend

Definition at line 35 of file MySQLPreparedStatement.h.

◆ PreparedStatementBase

friend class PreparedStatementBase
friend

Definition at line 36 of file MySQLPreparedStatement.h.

Member Data Documentation

◆ m_bind

◆ m_Mstmt

MySQLStmt* MySQLPreparedStatement::m_Mstmt
private

Definition at line 63 of file MySQLPreparedStatement.h.

Referenced by ~MySQLPreparedStatement().

◆ m_paramCount

uint32 MySQLPreparedStatement::m_paramCount
private

◆ m_paramsSet

std::vector<bool> MySQLPreparedStatement::m_paramsSet
private

◆ m_queryString

std::string const MySQLPreparedStatement::m_queryString
private

Definition at line 67 of file MySQLPreparedStatement.h.

Referenced by getQueryString().

◆ m_stmt

PreparedStatementBase* MySQLPreparedStatement::m_stmt
protected

Definition at line 57 of file MySQLPreparedStatement.h.

Referenced by AssertValidIndex(), BindParameters(), and getQueryString().


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