diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-03-02 22:50:56 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-03-02 22:51:18 +0100 |
commit | 30482038559d65648d9bcfa29cd426a6f266eeba (patch) | |
tree | e82255fc85fc55b6a06dafbb375bc904b612457f /src/server/database/Database/MySQLPreparedStatement.h | |
parent | 69809d12031d055d8d0cffb5a187d9af09dd0efe (diff) |
Core/DBLayer: Use std::variant's stored type instead of relying on our own separate enum for prepared statement parameters
Diffstat (limited to 'src/server/database/Database/MySQLPreparedStatement.h')
-rw-r--r-- | src/server/database/Database/MySQLPreparedStatement.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/server/database/Database/MySQLPreparedStatement.h b/src/server/database/Database/MySQLPreparedStatement.h index cd8a234e111..27ce911a0ba 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(PreparedStatement* 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; } PreparedStatement* m_stmt; |