10#include <userver/utils/fmt_compat.hpp>
11#include <userver/utils/strong_typedef.hpp>
13#include <userver/storages/clickhouse/io/impl/escape.hpp>
15USERVER_NAMESPACE_BEGIN
36 USERVER_NAMESPACE::utils::StrongTypedef<
struct NameTag, std::string>;
38 Query(
const char* text, std::optional<Name> = std::nullopt);
39 Query(std::string text, std::optional<Name> = std::nullopt);
41 const std::string& QueryText()
const&;
43 const std::optional<Name>& QueryName()
const&;
46 friend class QueryTester;
47 friend class impl::Pool;
50 template <
typename... Args>
51 Query WithArgs(
const Args&... args)
const {
54 return Query{fmt::format(fmt::runtime(text_), io::impl::Escape(args)...),
58 void FillSpanTags(
tracing::Span&)
const;
61 std::optional<Name> name_;