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>
32 static_assert(!
sizeof(T),
33 "Cannot convert from YDB value. No ValueTraits defined for "
34 "this type. userver/ydb/io/supported_types.hpp "
35 "contains all known definitions");
40 template <
typename Builder>
43 static_assert(!
sizeof(T),
44 "Cannot convert to YDB value. No ValueTraits defined for "
45 "this type. userver/ydb/io/supported_types.hpp "
46 "contains all known definitions");
50 static NYdb::TType
MakeType() =
delete;
55inline constexpr auto Parse =
56 [](NYdb::TValueParser& parser,
const ParseContext& context) -> T {
59 return ValueTraits<T>::Parse(parser, context);
63inline constexpr auto Write = [](
auto& builder,
auto&& value) {
67 std::remove_const_t<std::remove_reference_t<
decltype(value)>>;
69 std::conditional_t<std::is_convertible_v<RawValueType, std::string_view>,
70 std::string, RawValueType>;
71 ValueTraits<ValueType>::Write(builder, value);