11class TParamValueBuilder;
13template <
typename Builder>
14class TValueBuilderBase;
17USERVER_NAMESPACE_BEGIN
22struct ParseContext
final {
23 std::string_view column_name;
26template <
typename T,
typename Enable =
void>
33 "Cannot convert from YDB value. No ValueTraits defined for "
34 "this type. userver/ydb/io/supported_types.hpp "
35 "contains all known definitions"
41 template <
typename Builder>
45 "Cannot convert to YDB value. No ValueTraits defined for "
46 "this type. userver/ydb/io/supported_types.hpp "
47 "contains all known definitions"
52 static NYdb::TType
MakeType() =
delete;
57inline constexpr auto Parse = [](NYdb::TValueParser& parser,
const ParseContext& context) -> T {
60 return ValueTraits<T>::Parse(parser, context);
64inline constexpr auto Write = [](
auto& builder,
auto&& value) {
67 using RawValueType = std::remove_const_t<std::remove_reference_t<
decltype(value)>>;
69 std::conditional_t<std::is_convertible_v<RawValueType, std::string_view>, std::string, RawValueType>;
70 ValueTraits<ValueType>::Write(builder, value);