connection info in connection pool progress

This commit is contained in:
Sascha Kühl
2025-10-02 16:12:21 +02:00
parent 12905e3df3
commit 5490e67ecf
6 changed files with 15 additions and 11 deletions
+6 -2
View File
@@ -2,9 +2,10 @@
#include <chrono>
#include <thread>
#include <utility>
namespace matador::sql {
identifiable_connection::identifiable_connection(const size_t id, connection &&conn)
identifiable_connection::identifiable_connection(const size_t id, connection conn)
: id(id)
, conn(std::move(conn)){}
@@ -58,7 +59,10 @@ connection_pool::connection_pool(const std::string& dns, size_t count)
connection_repo_.reserve(count);
while (count) {
connection c(info_);
connection_repo_.emplace_back(count, std::move(c));
auto&& cc = std::move(c);
const auto ic = identifiable_connection{count, std::move(cc)};
connection_repo_.push_back(ic);
// connection_repo_.emplace_back(count, std::move(cc));
// connection_repo_.emplace_back(count, connection{info_});
auto &conn = connection_repo_.back();
idle_connections_.emplace(conn.id, &conn);