Example #1
0
void sqlite_prepared_result::read(const char *, varchar_base &x)
{
  int s = sqlite3_column_bytes(stmt_, result_index);
  const char *text = (const char*)sqlite3_column_text(stmt_, result_index++);
  if (s == 0) {
  } else {
    x.assign(text, s);
  }
}
Example #2
0
void query_update::write_pair(const char *id, data_type_t type, const varchar_base &x)
{
    if (first) {
      first = false;
    } else {
      dialect.append(", ");
    }
    dialect.append(std::string(id) + "=");
    std::stringstream valstr;
    valstr << "'" << x.str() << "'";
    dialect.append(id, type, valstr.str());
}
Example #3
0
void mysql_statement::write(const char *, const varchar_base &x)
{
  bind_value(host_array[host_index], MYSQL_TYPE_VAR_STRING, x.c_str(), x.size(), host_index);
  ++host_index;
}
Example #4
0
void sqlite_statement::write(const char*, const varchar_base &x)
{
  int ret = sqlite3_bind_text(stmt_, ++host_index, x.c_str(), x.size(), 0);
  throw_error(ret, db_(), "sqlite3_bind_text");
}