149
149
explicit connection_c(drizzle_c& drizzle)
151
b_= drizzle_con_create(drizzle);
155
throw "drizzle_con_create() failed";
151
drizzle_con_create(drizzle, *this);
157
152
read_conf_files();
162
drizzle_con_free(b_);
157
drizzle_con_free(*this);
165
160
operator drizzle_con_st*()
170
165
const char* error()
172
return drizzle_con_error(b_);
167
return drizzle_con_error(*this);
175
170
void set_tcp(const char* host, in_port_t port)
177
drizzle_con_set_tcp(b_, host, port);
172
drizzle_con_set_tcp(*this, host, port);
180
175
void set_auth(const char* user, const char* password)
182
drizzle_con_set_auth(b_, user, password);
177
drizzle_con_set_auth(*this, user, password);
185
180
void set_db(const char* db)
187
drizzle_con_set_db(b_, db);
182
drizzle_con_set_db(*this, db);
190
185
drizzle_return_t query(result_c& result, const char* str, size_t str_size)
192
187
drizzle_return_t ret;
194
188
drizzle_query(*this, result, str, str_size, &ret);
198
190
ret = drizzle_result_buffer(result);