Merge 'query*.h: add fmt::formatter for types' from Kefu Chai

* query::specific_ranges
* query::partition_slice
* query::read_command
* query::forward_request
* query::forward_request::reduction_type
* query::forward_request::aggregation_info
* query::forward_result::printer
* query::result_set
* query::result_set_row
* query::result::printer

Refs #13245

Closes scylladb/scylladb#17440

* github.com:scylladb/scylladb:
  query-result.hh: add formatter for query::result::printer
  query-result-set: add formatter for query-result-set.hh types
  query-request: add formatter for query-request.hh types
This commit is contained in:
Nadav Har'El
2024-02-21 14:46:36 +02:00
3 changed files with 17 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include <memory>
#include <optional>
#include <fmt/ostream.h>
#include "db/functions/function_name.hh"
#include "db/functions/function.hh"
@@ -517,3 +518,12 @@ struct forward_result {
std::ostream& operator<<(std::ostream& out, const query::forward_result::printer&);
}
template <> struct fmt::formatter<query::specific_ranges> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::partition_slice> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::read_command> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::forward_request> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::forward_request::reduction_type> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::forward_request::aggregation_info> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::forward_result::printer> : fmt::ostream_formatter {};

View File

@@ -10,6 +10,7 @@
#include <seastar/core/shared_ptr.hh>
#include <fmt/ostream.h>
#include "types/types.hh"
#include "schema/schema.hh"
@@ -129,3 +130,6 @@ inline bool operator==(const result_set& x, const result_set& y) {
}
}
template <> struct fmt::formatter<query::result_set> : fmt::ostream_formatter {};
template <> struct fmt::formatter<query::result_set_row> : fmt::ostream_formatter {};

View File

@@ -13,6 +13,7 @@
#include "query-request.hh"
#include "full_position.hh"
#include <optional>
#include <fmt/ostream.h>
#include <seastar/util/bool_class.hh>
#include "seastarx.hh"
@@ -450,3 +451,5 @@ public:
std::ostream& operator<<(std::ostream& os, const query::result::printer&);
}
template <> struct fmt::formatter<query::result::printer> : fmt::ostream_formatter {};