mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
feat(Core/DBLayer): replace char const* to std::string_view (#10211)
* feat(Core/DBLayer): replace `char const*` to `std::string_view` * CString * 1 * chore(Core/Misc): code cleanup * cl * db fix * fmt style sql * to fmt * py * del old * 1 * 2 * 3 * 1 * 1
This commit is contained in:
@@ -36,7 +36,7 @@ friend class MySQLConnection;
|
||||
friend class PreparedStatementBase;
|
||||
|
||||
public:
|
||||
MySQLPreparedStatement(MySQLStmt* stmt, std::string queryString);
|
||||
MySQLPreparedStatement(MySQLStmt* stmt, std::string_view queryString);
|
||||
~MySQLPreparedStatement();
|
||||
|
||||
void BindParameters(PreparedStatementBase* stmt);
|
||||
@@ -44,18 +44,19 @@ public:
|
||||
uint32 GetParameterCount() const { return m_paramCount; }
|
||||
|
||||
protected:
|
||||
void SetParameter(uint8 index, std::nullptr_t);
|
||||
void SetParameter(uint8 index, bool value);
|
||||
void SetParameter(const uint8 index, bool value);
|
||||
void SetParameter(const uint8 index, std::nullptr_t /*value*/);
|
||||
void SetParameter(const uint8 index, std::string const& value);
|
||||
void SetParameter(const uint8 index, std::vector<uint8> const& 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);
|
||||
void SetParameter(const uint8 index, T value);
|
||||
|
||||
MySQLStmt* GetSTMT() { return m_Mstmt; }
|
||||
MySQLBind* GetBind() { return m_bind; }
|
||||
PreparedStatementBase* m_stmt;
|
||||
void ClearParameters();
|
||||
void AssertValidIndex(uint8 index);
|
||||
void AssertValidIndex(const uint8 index);
|
||||
std::string getQueryString() const;
|
||||
|
||||
private:
|
||||
@@ -63,7 +64,7 @@ private:
|
||||
uint32 m_paramCount;
|
||||
std::vector<bool> m_paramsSet;
|
||||
MySQLBind* m_bind;
|
||||
std::string const m_queryString;
|
||||
std::string m_queryString{};
|
||||
|
||||
MySQLPreparedStatement(MySQLPreparedStatement const& right) = delete;
|
||||
MySQLPreparedStatement& operator=(MySQLPreparedStatement const& right) = delete;
|
||||
|
||||
Reference in New Issue
Block a user