22 #include "result_set.hpp" 24 namespace vgi {
namespace dbconn {
namespace dbi {
35 virtual void prepare(
const std::string& sql) = 0;
36 virtual void call(
const std::string& sql) = 0;
37 virtual iresult_set* execute(
const std::string& sql,
bool cursor =
false,
bool scrollable =
false) = 0;
39 virtual bool cancel() = 0;
40 virtual int proc_retval() = 0;
41 virtual void set_null(
size_t col_idx) = 0;
42 virtual void set_short(
size_t col_idx, int16_t val) = 0;
43 virtual void set_ushort(
size_t col_idx, uint16_t val) = 0;
44 virtual void set_int(
size_t col_idx, int32_t val) = 0;
45 virtual void set_uint(
size_t col_idx, uint32_t val) = 0;
46 virtual void set_long(
size_t col_idx, int64_t val) = 0;
47 virtual void set_ulong(
size_t col_idx, uint64_t val) = 0;
48 virtual void set_float(
size_t col_idx,
float val) = 0;
49 virtual void set_double(
size_t col_idx,
double val) = 0;
50 virtual void set_bool(
size_t col_idx,
bool val) = 0;
51 virtual void set_char(
size_t col_idx,
char val) = 0;
52 virtual void set_string(
size_t col_idx,
const std::string& val) = 0;
53 virtual void set_date(
size_t col_idx,
int val) = 0;
54 virtual void set_time(
size_t col_idx,
double val) = 0;
55 virtual void set_datetime(
size_t col_idx, time_t val) = 0;
56 virtual void set_u16char(
size_t col_idx, char16_t val) = 0;
57 virtual void set_u16string(
size_t col_idx,
const std::u16string& val) = 0;
58 virtual void set_binary(
size_t col_idx,
const std::vector<uint8_t>& val) = 0;
91 stmt_impl = std::move(stmt.stmt_impl);
101 stmt_impl->prepare(sql);
108 void call(
const std::string& proc)
110 stmt_impl->call(proc);
131 return result_set(stmt_impl->execute(sql, cursor, scrollable));
140 return stmt_impl->cancel();
151 return stmt_impl->proc_retval();
154 virtual void set_null(
size_t col_idx)
156 stmt_impl->set_null(col_idx);
159 virtual void set_short(
size_t col_idx, int16_t val)
161 stmt_impl->set_short(col_idx, val);
164 virtual void set_ushort(
size_t col_idx, uint16_t val)
166 stmt_impl->set_ushort(col_idx, val);
169 virtual void set_int(
size_t col_idx, int32_t val)
171 stmt_impl->set_int(col_idx, val);
174 virtual void set_uint(
size_t col_idx, uint32_t val)
176 stmt_impl->set_uint(col_idx, val);
179 virtual void set_long(
size_t col_idx, int64_t val)
181 stmt_impl->set_long(col_idx, val);
184 virtual void set_ulong(
size_t col_idx, uint64_t val)
186 stmt_impl->set_ulong(col_idx, val);
189 virtual void set_float(
size_t col_idx,
float val)
191 stmt_impl->set_float(col_idx, val);
194 virtual void set_double(
size_t col_idx,
double val)
196 stmt_impl->set_double(col_idx, val);
199 virtual void set_bool(
size_t col_idx,
bool val)
201 stmt_impl->set_bool(col_idx, val);
204 virtual void set_char(
size_t col_idx,
char val)
206 stmt_impl->set_char(col_idx, val);
209 virtual void set_string(
size_t col_idx,
const std::string& val)
211 stmt_impl->set_string(col_idx, val);
214 virtual void set_date(
size_t col_idx,
int val)
216 stmt_impl->set_date(col_idx, val);
219 virtual void set_time(
size_t col_idx,
double val)
221 stmt_impl->set_time(col_idx, val);
224 virtual void set_datetime(
size_t col_idx, time_t val)
226 stmt_impl->set_datetime(col_idx, val);
229 virtual void set_u16char(
size_t col_idx, char16_t val)
231 stmt_impl->set_u16char(col_idx, val);
234 virtual void set_u16string(
size_t col_idx,
const std::u16string& val)
236 stmt_impl->set_u16string(col_idx, val);
239 virtual void set_binary(
size_t col_idx,
const std::vector<uint8_t>& val)
241 stmt_impl->set_binary(col_idx, val);
251 std::unique_ptr<istatement> stmt_impl;
257 #endif // STATEMENT_HPP iresult_set - is an interface that describes common functionality for all concrete native implementat...
result_set execute(const std::string &sql, bool cursor=false, bool scrollable=false)
Function runs SQL statement.
statement - is a class that manages native driver statement handle.
istatement - is an interface that describes common functionality for all concrete native implementati...
void call(const std::string &proc)
Function prepares SQL stored procedure.
bool cancel()
Function cancels currently running SQL statements.
result_set execute()
Function runs last executed SQL statement.
statement & operator=(statement &&stmt)
Assignment operator.
statement(statement &&stmt)
Move constructor.
result_set - is a class that manages native driver result_set handle.
int proc_retval()
Function returns stored procedure return value.
void prepare(const std::string &sql)
Function prepares dynamic SQL statement.
connection - is a class that manages native driver connection handle.