96 using reference = row;
97 using const_iterator = const_result_iterator;
98 using pointer = const_iterator;
99 using iterator = const_iterator;
100 using const_reverse_iterator = const_reverse_result_iterator;
101 using reverse_iterator = const_reverse_iterator;
104 m_data{}, m_query{}, m_encoding{internal::encoding_group::MONOBYTE}
128 [[nodiscard]]
bool operator==(
result const &)
const noexcept;
132 return not operator==(rhs);
143 template<
typename... TYPE>
auto iter()
const;
145 [[nodiscard]] const_reverse_iterator rbegin()
const;
146 [[nodiscard]] const_reverse_iterator crbegin()
const;
147 [[nodiscard]] const_reverse_iterator rend()
const;
148 [[nodiscard]] const_reverse_iterator crend()
const;
150 [[nodiscard]] const_iterator begin() const noexcept;
151 [[nodiscard]] const_iterator cbegin() const noexcept;
152 [[nodiscard]] inline const_iterator end() const noexcept;
153 [[nodiscard]] inline const_iterator cend() const noexcept;
155 [[nodiscard]] reference front() const noexcept;
156 [[nodiscard]] reference back() const noexcept;
158 [[nodiscard]] PQXX_PURE size_type size() const noexcept;
159 [[nodiscard]] PQXX_PURE
bool empty() const noexcept;
160 [[nodiscard]] size_type capacity() const noexcept {
return size(); }
167 void swap(result &)
noexcept;
174 [[nodiscard]] row operator[](size_type i)
const noexcept;
176#if defined(PQXX_HAVE_MULTIDIM)
178 operator[](size_type row_num, row_size_type col_num)
const noexcept;
182 row at(size_type)
const;
185 field at(size_type, row_size_type)
const;
206 [[nodiscard]] PQXX_PURE
row_size_type columns() const noexcept;
212 [[nodiscard]]
char const *column_name(
row_size_type number) const &;
218 [[nodiscard]]
int column_storage(
row_size_type number) const;
231 [[nodiscard]]
int column_type_modifier(
row_size_type number) const noexcept;
237 [[nodiscard]]
oid column_type(
zview col_name)
const
239 return column_type(column_number(col_name));
248 return column_table(column_number(col_name));
257 return table_column(column_number(col_name));
262 [[nodiscard]] PQXX_PURE std::string
const &query() const & noexcept;
268 [[nodiscard]] PQXX_PURE
oid inserted_oid() const;
274 [[nodiscard]] PQXX_PURE size_type affected_rows() const;
315 template<typename CALLABLE> inline
void for_each(CALLABLE &&func) const;
323 auto const sz{size()};
327 if (not m_query or m_query->empty())
329 "Expected ", n,
" row(s) from query, got ", sz,
".")};
332 "Expected ", n,
" row(s) from query '", *m_query,
"', got ", sz,
350 std::optional<row> opt_row()
const;
365 auto const actual{columns()};
369 if (not m_query or m_query->empty())
371 "Expected 1 column from query, got ", actual,
".")};
374 "Expected 1 column from query '", *m_query,
"', got ", actual,
".")};
383 field one_field()
const;
386 using data_pointer = std::shared_ptr<internal::pq::PGresult const>;
392 PQXX_PURE std::shared_ptr<std::string const> query_ptr() const noexcept
398 std::shared_ptr<std::string const> m_query;
405 std::shared_ptr<pqxx::internal::notice_waiters> m_notice_waiters;
407 internal::encoding_group m_encoding;
409 static std::string
const s_empty_string;
411 friend class pqxx::field;
412 PQXX_PURE
char const *
413 get_value(size_type row, row_size_type col)
const noexcept;
414 PQXX_PURE
bool get_is_null(size_type row, row_size_type col)
const noexcept;
416 field_size_type get_length(size_type, row_size_type)
const noexcept;
420 std::shared_ptr<internal::pq::PGresult>
const &rhs,
421 std::shared_ptr<std::string>
const &query,
422 std::shared_ptr<pqxx::internal::notice_waiters>
const &waiters,
423 internal::encoding_group enc);
425 PQXX_PRIVATE
void check_status(std::string_view desc =
""sv)
const;
428 friend class pqxx::internal::gate::result_row;
429 bool operator!() const noexcept {
return m_data.get() ==
nullptr; }
430 operator bool() const noexcept {
return m_data.get() !=
nullptr; }
432 [[noreturn]] PQXX_PRIVATE PQXX_COLD
void
433 throw_sql_error(std::string
const &Err, std::string
const &Query)
const;
434 PQXX_PRIVATE PQXX_PURE
int errorposition()
const;
435 PQXX_PRIVATE std::string status_error()
const;
438 PQXX_PURE
char const *cmd_status() const noexcept;