row::column_type row::column(const string &name) const { if (name.empty()) { throw no_such_column_exception(); } for (size_t i = 0; i < size_; i++) { const char *col_name = PQfname(stmt_.get(), i); if (name == col_name) { return column(i); } } throw no_such_column_exception(name); }
int column::sql_type() const { if (!is_valid()) { throw no_such_column_exception(); } return PQftype(stmt_.get(), column_); }
string row::column_name(size_t nPosition) const { if (nPosition >= size()) { throw no_such_column_exception(); } return PQfname(stmt_.get(), nPosition); }
row::column_type row::column(size_t nPosition) const { if (nPosition >= size() || row_ == -1) { throw no_such_column_exception(); } return column_type(make_shared<postgres::column>(stmt_, row_, nPosition)); }
sql_value column::to_value() const { if (!is_valid()) { throw no_such_column_exception(); } return data_mapper::to_value(stmt_, column_); }
row::column_type row::column(size_t nPosition) const { if (nPosition >= size()) { throw no_such_column_exception(); } return column_type(make_shared<sqlite::column>(stmt_, nPosition)); }
sql_value column::to_value() const { if (!is_valid()) { throw no_such_column_exception(); } return data_mapper::to_value(PQftype(stmt_.get(), column_), PQgetvalue(stmt_.get(), row_, column_), PQgetlength(stmt_.get(), row_, column_)); }