175
187
drizzle_con_st b_;
179
inline drizzle_return_t query(drizzle_con_st* con, result_c& result, const char* str, size_t str_size)
181
drizzle_return_t ret;
182
drizzle_query(con, &result.b_, str, str_size, &ret);
183
if (ret == DRIZZLE_RETURN_OK)
184
ret = drizzle_result_buffer(&result.b_);
188
inline drizzle_return_t query(drizzle_con_st* con, result_c& result, const std::string& str)
190
return query(con, result, str.data(), str.size());
193
inline drizzle_return_t query(drizzle_con_st* con, result_c& result, const char* str)
195
return query(con, result, str, strlen(str));
193
query_c(connection_c& con, const std::string& in = "") :
199
void operator=(const std::string& v)
205
void operator+=(const std::string& v)
210
query_c& p_name(const std::string& v)
212
std::vector<char> r(2 * v.size() + 2);
213
r.resize(drizzle_escape_string(&r.front() + 1, v.data(), v.size()) + 2);
216
p_raw(&r.front(), r.size());
220
query_c& p_raw(const char* v, size_t sz)
222
size_t i = in_.find('?');
223
assert(i != std::string::npos);
224
if (i == std::string::npos)
226
out_.append(in_.substr(0, i));
232
query_c& p_raw(const std::string& v)
234
return p_raw(v.data(), v.size());
237
query_c& p(const std::string& v)
239
std::vector<char> r(2 * v.size() + 2);
240
r.resize(drizzle_escape_string(&r.front() + 1, v.data(), v.size()) + 2);
243
p_raw(&r.front(), r.size());
247
query_c& p(long long v)
249
std::stringstream ss;
255
drizzle_return_t execute(result_c& result)
257
return con_.query(result, read());
260
std::string read() const