statement cache progress
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -48,8 +49,14 @@ public:
|
||||
Connection* operator->() { return &connection_->second; }
|
||||
Connection& operator*() { return connection_->second; }
|
||||
|
||||
[[nodiscard]] size_t id() const { return connection_->first; }
|
||||
|
||||
[[nodiscard]] std::optional<size_t> id() const
|
||||
{
|
||||
if (connection_) {
|
||||
return connection_->first;
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
[[nodiscard]] bool valid() const { return connection_ != nullptr; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -27,15 +27,8 @@ public:
|
||||
data_type_traits<Type>::bind_value(binder(), pos, val);
|
||||
}
|
||||
|
||||
void bind(size_t pos, const char *value, size_t size)
|
||||
{
|
||||
data_type_traits<const char*>::bind_value(binder(), pos, value, size);
|
||||
}
|
||||
|
||||
void bind(size_t pos, std::string &val, size_t size)
|
||||
{
|
||||
data_type_traits<std::string>::bind_value(binder(), pos, val, size);
|
||||
}
|
||||
void bind(size_t pos, const char *value, size_t size);
|
||||
void bind(size_t pos, std::string &val, size_t size);
|
||||
|
||||
virtual void reset() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user