9#include <userver/formats/json_fwd.hpp>
11#include <userver/storages/mysql/dates.hpp>
12#include <userver/storages/mysql/impl/binder_fwd.hpp>
14USERVER_NAMESPACE_BEGIN
19class ExplicitRef final {
21 explicit ExplicitRef(T& ref) : ref_{ref} {}
22 explicit ExplicitRef(T&& ref) =
delete;
24 T& Get() {
return ref_; }
31class ExplicitCRef final {
33 static_assert(!std::is_const_v<T>);
35 explicit ExplicitCRef(
const T& ref) : ref_{ref} {}
36 explicit ExplicitCRef(T&& ref) =
delete;
38 const T& Get()
const {
return ref_; }
47void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
48 ExplicitRef<std::uint8_t> val);
49void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
50 ExplicitRef<std::optional<std::uint8_t>> val);
51void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
52 ExplicitRef<std::int8_t> val);
53void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
54 ExplicitRef<std::optional<std::int8_t>> val);
56void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
57 ExplicitRef<std::uint16_t> val);
58void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
59 ExplicitRef<std::optional<std::uint16_t>> val);
60void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
61 ExplicitRef<std::int16_t> val);
62void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
63 ExplicitRef<std::optional<std::int16_t>> val);
65void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
66 ExplicitRef<std::uint32_t> val);
67void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
68 ExplicitRef<std::optional<std::uint32_t>> val);
69void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
70 ExplicitRef<std::int32_t> val);
71void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
72 ExplicitRef<std::optional<std::int32_t>> val);
74void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
75 ExplicitRef<std::uint64_t> val);
76void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
77 ExplicitRef<std::optional<std::uint64_t>> val);
78void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
79 ExplicitRef<std::int64_t> val);
80void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
81 ExplicitRef<std::optional<std::int64_t>> val);
83void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
84 ExplicitRef<
float> val);
85void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
86 ExplicitRef<std::optional<
float>> val);
87void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
88 ExplicitRef<
double> val);
89void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
90 ExplicitRef<std::optional<
double>> val);
92void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
93 ExplicitRef<std::string> val);
94void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
95 ExplicitRef<std::optional<std::string>> val);
97void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
98 ExplicitRef<formats::
json::Value> val);
99void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
100 ExplicitRef<std::optional<formats::
json::Value>> val);
103void FreestandingBind(OutputBindingsFwd&, std::size_t,
104 ExplicitRef<std::string_view>);
105void FreestandingBind(OutputBindingsFwd&, std::size_t,
106 ExplicitRef<std::optional<std::string_view>>);
108void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
109 ExplicitRef<std::chrono::system_clock::time_point> val);
110void FreestandingBind(
111 OutputBindingsFwd& binds, std::size_t pos,
112 ExplicitRef<std::optional<std::chrono::system_clock::time_point>> val);
113void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
114 ExplicitRef<Date> val);
115void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
116 ExplicitRef<std::optional<Date>> val);
117void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
118 ExplicitRef<DateTime> val);
119void FreestandingBind(OutputBindingsFwd& binds, std::size_t pos,
120 ExplicitRef<std::optional<DateTime>> val);
123void FreestandingBind(OutputBindingsFwd&, std::size_t, ExplicitRef<T>) {
124 static_assert(!
sizeof(T),
"IO support for the type is not implemented.");
128void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
129 ExplicitCRef<std::uint8_t> val);
130void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
131 ExplicitCRef<std::int8_t> val);
133void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
134 ExplicitCRef<std::uint16_t> val);
135void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
136 ExplicitCRef<std::int16_t> val);
138void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
139 ExplicitCRef<std::uint32_t> val);
140void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
141 ExplicitCRef<std::int32_t> val);
143void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
144 ExplicitCRef<std::uint64_t> val);
145void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
146 ExplicitCRef<std::int64_t> val);
148void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
149 ExplicitCRef<
float> val);
150void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
151 ExplicitCRef<
double> val);
153void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
154 ExplicitCRef<std::string> val);
155void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
156 ExplicitCRef<std::string_view> val);
157void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
158 ExplicitCRef<formats::
json::Value> val);
160void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
161 ExplicitCRef<std::chrono::system_clock::time_point> val);
162void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
163 ExplicitCRef<Date> val);
164void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
165 ExplicitCRef<DateTime> val);
167void BindNull(InputBindingsFwd& binds, std::size_t pos);
170void FreestandingBind(InputBindingsFwd& binds, std::size_t pos,
171 ExplicitCRef<std::optional<T>> val) {
172 if (val.Get().has_value()) {
174 ExplicitCRef<T>{*val.Get()});
181void FreestandingBind(InputBindingsFwd&, std::size_t, ExplicitCRef<T>) {
182 static_assert(!
sizeof(T),
"IO support for the type is not implemented.");