aboutsummaryrefslogtreecommitdiff
path: root/src/server/database/Database/MySQLPreparedStatement.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-03-02 22:50:56 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-22 21:39:35 +0100
commitcecb36bd68d30408a0741b161318aadc70a81e20 (patch)
treee61a09589006e64da71e5270acd6336447a3885f /src/server/database/Database/MySQLPreparedStatement.h
parentdab7e5688c55d4b785a9277d15ea55e075870849 (diff)
Core/DBLayer: Use std::variant's stored type instead of relying on our own separate enum for prepared statement parameters
(cherry picked from commit 30482038559d65648d9bcfa29cd426a6f266eeba)
Diffstat (limited to 'src/server/database/Database/MySQLPreparedStatement.h')
-rw-r--r--src/server/database/Database/MySQLPreparedStatement.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/server/database/Database/MySQLPreparedStatement.h b/src/server/database/Database/MySQLPreparedStatement.h
index 9a06e7ef92e..d03ce29c480 100644
--- a/src/server/database/Database/MySQLPreparedStatement.h
+++ b/src/server/database/Database/MySQLPreparedStatement.h
@@ -41,24 +41,16 @@ class TC_DATABASE_API MySQLPreparedStatement
void BindParameters(PreparedStatementBase* stmt);
- void setNull(const uint8 index);
- void setBool(const uint8 index, const bool value);
- void setUInt8(const uint8 index, const uint8 value);
- void setUInt16(const uint8 index, const uint16 value);
- void setUInt32(const uint8 index, const uint32 value);
- void setUInt64(const uint8 index, const uint64 value);
- void setInt8(const uint8 index, const int8 value);
- void setInt16(const uint8 index, const int16 value);
- void setInt32(const uint8 index, const int32 value);
- void setInt64(const uint8 index, const int64 value);
- void setFloat(const uint8 index, const float value);
- void setDouble(const uint8 index, const double value);
- void setString(const uint8 index, const std::string& value);
- void setBinary(const uint8 index, const std::vector<uint8>& value);
-
uint32 GetParameterCount() const { return m_paramCount; }
protected:
+ 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, std::string const& value);
+ void SetParameter(uint8 index, std::vector<uint8> const& value);
+
MySQLStmt* GetSTMT() { return m_Mstmt; }
MySQLBind* GetBind() { return m_bind; }
PreparedStatementBase* m_stmt;