16#if !defined(PQXX_HEADER_PRE)
17# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
105 m_data{}, m_query{}, m_encoding{internal::encoding_group::MONOBYTE}
144 template<
typename... TYPE>
auto iter()
const;
146 [[nodiscard]] const_reverse_iterator rbegin()
const;
147 [[nodiscard]] const_reverse_iterator crbegin()
const;
148 [[nodiscard]] const_reverse_iterator rend()
const;
149 [[nodiscard]] const_reverse_iterator crend()
const;
151 [[nodiscard]] const_iterator begin() const noexcept;
152 [[nodiscard]] const_iterator cbegin() const noexcept;
153 [[nodiscard]] inline const_iterator end() const noexcept;
154 [[nodiscard]] inline const_iterator cend() const noexcept;
156 [[nodiscard]] reference front() const noexcept;
157 [[nodiscard]] reference back() const noexcept;
159 [[nodiscard]]
PQXX_PURE size_type size() const noexcept;
160 [[nodiscard]]
PQXX_PURE bool empty() const noexcept;
168 void swap(
result &)
noexcept;
175 [[nodiscard]] row operator[](size_type i)
const noexcept;
177#if defined(PQXX_HAVE_MULTIDIM)
179 operator[](size_type row_num,
row_size_type col_num)
const noexcept;
183 row at(size_type)
const;
213 [[nodiscard]]
char const *column_name(
row_size_type number) const &;
219 [[nodiscard]]
int column_storage(
row_size_type number) const;
232 [[nodiscard]]
int column_type_modifier(
row_size_type number) const noexcept;
263 [[nodiscard]]
PQXX_PURE std::string
const &query() const & noexcept;
275 [[nodiscard]]
PQXX_PURE size_type affected_rows() const;
316 template<typename CALLABLE> inline
void for_each(CALLABLE &&func) const;
324 auto const sz{
size()};
328 if (not m_query or m_query->empty())
330 "Expected ", n,
" row(s) from query, got ", sz,
".")};
333 "Expected ", n,
" row(s) from query '", *m_query,
"', got ", sz,
351 std::optional<row> opt_row()
const;
370 if (not m_query or m_query->empty())
372 "Expected ", cols,
" column(s) from query, got ", actual,
".")};
375 "Expected ", cols,
" column(s) from query '", *m_query,
"', got ",
385 field one_field()
const;
388 using data_pointer = std::shared_ptr<internal::pq::PGresult const>;
394 PQXX_PURE std::shared_ptr<std::string const> query_ptr() const noexcept
400 std::shared_ptr<std::string const> m_query;
407 std::shared_ptr<pqxx::internal::notice_waiters> m_notice_waiters;
411 static std::string
const s_empty_string;
413 friend class pqxx::field;
422 std::shared_ptr<internal::pq::PGresult>
const &rhs,
423 std::shared_ptr<std::string>
const &
query,
424 std::shared_ptr<pqxx::internal::notice_waiters>
const &waiters,
427 PQXX_PRIVATE void check_status(std::string_view desc =
""sv)
const;
430 friend class pqxx::internal::gate::result_row;
431 bool operator!() const noexcept {
return m_data.get() ==
nullptr; }
432 operator bool() const noexcept {
return m_data.get() !=
nullptr; }
435 throw_sql_error(std::string
const &Err, std::string
const &Query)
const;
440 PQXX_PURE char const *cmd_status() const noexcept;
Definition result-connection.hxx:6
Definition result-creation.hxx:6
Definition result-pipeline.hxx:6
Definition result-sql_cursor.hxx:6
Result set containing data returned by a query or command.
Definition result.hxx:93
PQXX_PURE row_size_type columns() const noexcept
Number of columns in result.
Definition result.cxx:514
const_reverse_result_iterator const_reverse_iterator
Definition result.hxx:101
oid column_type(row_size_type col_num) const
Return column's type, as an OID from the system catalogue.
result(result &&rhs) noexcept=default
row_size_type table_column(zview col_name) const
What column in its table did this column come from?
Definition result.hxx:256
row reference
Definition result.hxx:97
result() noexcept
Definition result.hxx:104
result & operator=(result &&rhs) noexcept=default
Assign one result to another, invaliding the old one.
result_size_type size_type
Definition result.hxx:95
bool operator==(result const &) const noexcept
Compare two results for equality.
Definition result.cxx:65
oid column_table(row_size_type col_num) const
What table did this column come from?
bool operator!=(result const &rhs) const noexcept
Compare two results for inequality.
Definition result.hxx:131
result expect_rows(size_type n) const
Check that result contains exactly n rows.
Definition result.hxx:322
const_iterator pointer
Definition result.hxx:99
void clear() noexcept
Let go of the result's data.
Definition result.hxx:196
row_size_type table_column(row_size_type col_num) const
What column in its table did this column come from?
const_iterator iterator
Definition result.hxx:100
row_size_type column_number(zview name) const
Number of given column (throws exception if it doesn't exist).
Definition result.cxx:434
result_difference_type difference_type
Definition result.hxx:96
size_type capacity() const noexcept
Definition result.hxx:161
PQXX_PURE std::string const & query() const &noexcept
Query that produced this result, if available (empty string otherwise).
Definition result.cxx:372
PQXX_PURE size_type size() const noexcept
Definition result.cxx:115
result expect_columns(row_size_type cols) const
Expect that result consists of exactly cols columns.
Definition result.hxx:364
const_reverse_iterator reverse_iterator
Definition result.hxx:102
oid column_table(zview col_name) const
What table did this column come from?
Definition result.hxx:247
result & operator=(result const &rhs) noexcept=default
Assign one result to another.
const_result_iterator const_iterator
Definition result.hxx:98
result no_rows() const
Expect that result contains no rows. Return result for convenience.
Definition result.hxx:354
result(result const &rhs) noexcept=default
Marker-type wrapper: zero-terminated std::string_view.
Definition zview.hxx:38
Query returned an unexpected number of rows.
Definition except.hxx:343
Error in usage of libpqxx library, similar to std::logic_error.
Definition except.hxx:249
Definition connection.hxx:108
pg_result PGresult
Definition libpq-forward.hxx:25
Internal items for libpqxx' own use. Do not use these yourself.
Definition encodings.cxx:33
std::string concat(TYPE... item)
Efficiently combine a bunch of items into one big string.
Definition concat.hxx:31
encoding_group
Definition encoding_group.hxx:19
PQXX_LIBEXPORT void clear_result(pq::PGresult const *) noexcept
C++ wrapper for libpq's PQclear.
Definition result.cxx:43
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27
unsigned int oid
PostgreSQL database row identifier.
Definition libpq-forward.hxx:33
std::size_t field_size_type
Number of bytes in a field of database data.
Definition types.hxx:40
int result_size_type
Number of rows in a result set.
Definition types.hxx:28
int row_size_type
Number of fields in a row of database data.
Definition types.hxx:34
int result_difference_type
Difference between result sizes.
Definition types.hxx:31
std::function< void(zview)> notice_handler
Definition result.hxx:57
notice_waiters & operator=(notice_waiters &&)=delete
notice_waiters(notice_waiters &&)=delete
notice_waiters & operator=(notice_waiters const &)=delete
notice_waiters(notice_waiters const &)=delete
std::list< errorhandler * > errorhandlers
Definition result.hxx:58