@@ -11,7 +11,7 @@ USERVER_NAMESPACE_BEGIN
1111
1212namespace storages ::scylla::impl::driver {
1313class DriverTableImpl ;
14- } // namespace storages::scylla::impl::driver
14+ }
1515
1616namespace storages ::scylla::operations {
1717
@@ -83,6 +83,194 @@ class SelectOne {
8383 utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
8484};
8585
86- } // namespace storages::scylla::operations
86+ class DeleteOne {
87+ public:
88+ DeleteOne ();
89+ ~DeleteOne ();
90+
91+ DeleteOne (const DeleteOne&);
92+ DeleteOne (DeleteOne&&) noexcept ;
93+ DeleteOne& operator =(const DeleteOne&);
94+ DeleteOne& operator =(DeleteOne&&) noexcept ;
95+
96+ void WhereString (std::string column_name, std::string value);
97+ void WhereInt32 (std::string column_name, int32_t value);
98+ void WhereInt64 (std::string column_name, int64_t value);
99+ void WhereBool (std::string column_name, bool value);
100+ void WhereFloat (std::string column_name, float value);
101+ void WhereDouble (std::string column_name, double value);
102+
103+ private:
104+ friend class storages ::scylla::impl::driver::DriverTableImpl;
105+
106+ struct Condition {
107+ std::string column_name;
108+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
109+ };
110+
111+ class Impl ;
112+ static constexpr size_t kSize = 64 ;
113+ static constexpr size_t kAlignment = 8 ;
114+ utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
115+ };
116+
117+ class SelectMany {
118+ public:
119+ using Value = std::variant<std::string, int32_t , int64_t , bool , float , double >;
120+ using Row = std::vector<std::pair<std::string, Value>>;
121+ using ResultSet = std::vector<Row>;
122+
123+ SelectMany ();
124+ ~SelectMany ();
125+
126+ SelectMany (const SelectMany&);
127+ SelectMany (SelectMany&&) noexcept ;
128+ SelectMany& operator =(const SelectMany&);
129+ SelectMany& operator =(SelectMany&&) noexcept ;
130+
131+ void AddColumn (std::string column_name);
132+ void AddAllColumns ();
133+
134+ void WhereString (std::string column_name, std::string value);
135+ void WhereInt32 (std::string column_name, int32_t value);
136+ void WhereInt64 (std::string column_name, int64_t value);
137+ void WhereBool (std::string column_name, bool value);
138+ void WhereFloat (std::string column_name, float value);
139+ void WhereDouble (std::string column_name, double value);
140+
141+ void SetLimit (size_t limit);
142+
143+ private:
144+ friend class storages ::scylla::impl::driver::DriverTableImpl;
145+
146+ struct Condition {
147+ std::string column_name;
148+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
149+ };
150+
151+ class Impl ;
152+ static constexpr size_t kSize = 128 ;
153+ static constexpr size_t kAlignment = 8 ;
154+ utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
155+ };
156+
157+ class UpdateOne {
158+ public:
159+ UpdateOne ();
160+ ~UpdateOne ();
161+
162+ UpdateOne (const UpdateOne&);
163+ UpdateOne (UpdateOne&&) noexcept ;
164+ UpdateOne& operator =(const UpdateOne&);
165+ UpdateOne& operator =(UpdateOne&&) noexcept ;
166+
167+ void SetString (std::string column_name, std::string value);
168+ void SetInt32 (std::string column_name, int32_t value);
169+ void SetInt64 (std::string column_name, int64_t value);
170+ void SetBool (std::string column_name, bool value);
171+ void SetFloat (std::string column_name, float value);
172+ void SetDouble (std::string column_name, double value);
173+
174+ void WhereString (std::string column_name, std::string value);
175+ void WhereInt32 (std::string column_name, int32_t value);
176+ void WhereInt64 (std::string column_name, int64_t value);
177+ void WhereBool (std::string column_name, bool value);
178+ void WhereFloat (std::string column_name, float value);
179+ void WhereDouble (std::string column_name, double value);
180+
181+ private:
182+ friend class storages ::scylla::impl::driver::DriverTableImpl;
183+
184+ struct Assignment {
185+ std::string column_name;
186+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
187+ };
188+ struct Condition {
189+ std::string column_name;
190+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
191+ };
192+
193+ class Impl ;
194+ static constexpr size_t kSize = 128 ;
195+ static constexpr size_t kAlignment = 8 ;
196+ utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
197+ };
198+
199+ class Count {
200+ public:
201+ Count ();
202+ ~Count ();
203+
204+ Count (const Count&);
205+ Count (Count&&) noexcept ;
206+ Count& operator =(const Count&);
207+ Count& operator =(Count&&) noexcept ;
208+
209+ void WhereString (std::string column_name, std::string value);
210+ void WhereInt32 (std::string column_name, int32_t value);
211+ void WhereInt64 (std::string column_name, int64_t value);
212+ void WhereBool (std::string column_name, bool value);
213+ void WhereFloat (std::string column_name, float value);
214+ void WhereDouble (std::string column_name, double value);
215+
216+ private:
217+ friend class storages ::scylla::impl::driver::DriverTableImpl;
218+
219+ struct Condition {
220+ std::string column_name;
221+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
222+ };
223+
224+ class Impl ;
225+ static constexpr size_t kSize = 64 ;
226+ static constexpr size_t kAlignment = 8 ;
227+ utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
228+ };
229+
230+ class InsertMany {
231+ public:
232+ InsertMany ();
233+ ~InsertMany ();
234+
235+ InsertMany (const InsertMany&);
236+ InsertMany (InsertMany&&) noexcept ;
237+ InsertMany& operator =(const InsertMany&);
238+ InsertMany& operator =(InsertMany&&) noexcept ;
239+
240+ void NextRow ();
241+
242+ void BindString (std::string column_name, std::string value);
243+ void BindInt32 (std::string column_name, int32_t value);
244+ void BindInt64 (std::string column_name, int64_t value);
245+ void BindBool (std::string column_name, bool value);
246+ void BindFloat (std::string column_name, float value);
247+ void BindDouble (std::string column_name, double value);
248+
249+ private:
250+ friend class storages ::scylla::impl::driver::DriverTableImpl;
251+
252+ struct Binding {
253+ std::string column_name;
254+ std::variant<std::string, int32_t , int64_t , bool , float , double > value;
255+ };
256+
257+ class Impl ;
258+ static constexpr size_t kSize = 64 ;
259+ static constexpr size_t kAlignment = 8 ;
260+ utils::FastPimpl<Impl, kSize , kAlignment , false > impl_;
261+ };
262+
263+ class Truncate {
264+ public:
265+ Truncate () = default ;
266+ ~Truncate () = default ;
267+
268+ Truncate (const Truncate&) = default ;
269+ Truncate (Truncate&&) noexcept = default ;
270+ Truncate& operator =(const Truncate&) = default ;
271+ Truncate& operator =(Truncate&&) noexcept = default ;
272+ };
273+
274+ }
87275
88- USERVER_NAMESPACE_END
276+ USERVER_NAMESPACE_END
0 commit comments