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:
Kargatum
2022-02-05 06:37:11 +07:00
committed by GitHub
parent d6ead1d1e0
commit de13bf426e
140 changed files with 5055 additions and 4882 deletions

View File

@@ -24,8 +24,7 @@
class AC_DATABASE_API SQLQueryHolderBase
{
friend class SQLQueryHolderTask;
private:
std::vector<std::pair<PreparedStatementBase*, PreparedQueryResult>> m_queries;
public:
SQLQueryHolderBase() = default;
virtual ~SQLQueryHolderBase();
@@ -35,6 +34,9 @@ public:
protected:
bool SetPreparedQueryImpl(size_t index, PreparedStatementBase* stmt);
private:
std::vector<std::pair<PreparedStatementBase*, PreparedQueryResult>> m_queries;
};
template<typename T>
@@ -49,10 +51,6 @@ public:
class AC_DATABASE_API SQLQueryHolderTask : public SQLOperation
{
private:
std::shared_ptr<SQLQueryHolderBase> m_holder;
QueryResultHolderPromise m_result;
public:
explicit SQLQueryHolderTask(std::shared_ptr<SQLQueryHolderBase> holder)
: m_holder(std::move(holder)) { }
@@ -61,6 +59,10 @@ public:
bool Execute() override;
QueryResultHolderFuture GetFuture() { return m_result.get_future(); }
private:
std::shared_ptr<SQLQueryHolderBase> m_holder;
QueryResultHolderPromise m_result;
};
class AC_DATABASE_API SQLQueryHolderCallback
@@ -70,7 +72,6 @@ public:
: m_holder(std::move(holder)), m_future(std::move(future)) { }
SQLQueryHolderCallback(SQLQueryHolderCallback&&) = default;
SQLQueryHolderCallback& operator=(SQLQueryHolderCallback&&) = default;
void AfterComplete(std::function<void(SQLQueryHolderBase const&)> callback) &