7#include <userver/dynamic_config/source.hpp>
15class StatementStatsStorage;
21 explicit ConnectionPtr(std::unique_ptr<Connection>&& conn);
22 ConnectionPtr(Connection* conn, std::shared_ptr<ConnectionPool>&& pool);
25 ConnectionPtr(ConnectionPtr&&)
noexcept;
26 ConnectionPtr& operator=(ConnectionPtr&&)
noexcept;
28 explicit operator
bool()
const noexcept;
29 Connection* get()
const noexcept;
31 Connection& operator*()
const;
32 Connection* operator->()
const noexcept;
34 const StatementStatsStorage* GetStatementStatsStorage()
const;
35 std::optional<dynamic_config::Source> GetConfigSource()
const;
38 void Reset(std::unique_ptr<Connection> conn,
39 std::shared_ptr<ConnectionPool> pool);
42 std::shared_ptr<ConnectionPool> pool_;
43 std::unique_ptr<Connection> conn_;