userver: userver/storages/clickhouse/impl/pool.hpp Source File
Loading...
Searching...
No Matches
pool.hpp
1#pragma once
2
3#include <memory>
4
5#include <userver/storages/clickhouse/execution_result.hpp>
6#include <userver/storages/clickhouse/options.hpp>
7
8#include <userver/clients/dns/resolver_fwd.hpp>
9#include <userver/utils/statistics/writer.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace storages::clickhouse {
14
15class Query;
16
17namespace impl {
18class PoolImpl;
19struct PoolSettings;
20class InsertionRequest;
21
22class Pool final {
23 public:
24 Pool(clients::dns::Resolver&, PoolSettings&&);
25 ~Pool();
26
27 Pool(const Pool&) = delete;
28 Pool(Pool&&) = default;
29
30 ExecutionResult Execute(OptionalCommandControl, const Query& query) const;
31
32 void Insert(OptionalCommandControl, const InsertionRequest& request) const;
33
34 void WriteStatistics(
35 USERVER_NAMESPACE::utils::statistics::Writer& writer) const;
36
37 bool IsAvailable() const;
38
39 private:
40 std::shared_ptr<PoolImpl> impl_;
41};
42} // namespace impl
43
44} // namespace storages::clickhouse
45
46USERVER_NAMESPACE_END