libpqxx
The C++ client library for PostgreSQL
result-field_ref.hxx
Go to the documentation of this file.
2 
3 namespace pqxx::internal::gate
4 {
5 class PQXX_PRIVATE result_field_ref final : callgate<result const>
6 {
7  friend class pqxx::field_ref;
8 
9  constexpr result_field_ref(reference x) : super(x) {}
10 
11  [[nodiscard]] PQXX_PURE char const *
12  get_value(result_size_type row_num, row_size_type col_num) const noexcept
13  {
14  return home().get_value(row_num, col_num);
15  }
16 
17  [[nodiscard]] PQXX_PURE bool
18  get_is_null(result_size_type row_num, row_size_type col_num) const noexcept
19  {
20  return home().get_is_null(row_num, col_num);
21  }
22 
23  [[nodiscard]] PQXX_PURE field_size_type
24  get_length(result_size_type row_num, row_size_type col_num) const noexcept
25  {
26  return home().get_length(row_num, col_num);
27  }
28 
29  [[nodiscard]] oid column_type(row_size_type col_num, sl loc) const
30  {
31  return home().column_type(col_num, loc);
32  }
33 
34  [[nodiscard]] oid column_table(row_size_type col_num, sl loc) const
35  {
36  return home().column_table(col_num, loc);
37  }
38 
39  [[nodiscard]] encoding_group encoding() const noexcept
40  {
41  return home().m_encoding;
42  }
43 };
44 } // namespace pqxx::internal::gate
Lightweight reference to a field in a result set.
Definition: field.hxx:52
PQXX_PURE result const & home() const noexcept
Definition: field.hxx:67
Base class for call gates.
Definition: callgate.hxx:55
result const & reference
A reference to the host class. Helps keep constructors easy.
Definition: callgate.hxx:60
Definition: result-field_ref.hxx:6
oid column_table(row_size_type col_num, sl=sl::current()) const
What table did this column come from?
Definition: result.cxx:473
oid column_type(row_size_type col_num, sl=sl::current()) const
Return column's type, as an OID from the system catalogue.
Definition: result.cxx:449
#define PQXX_PURE
Definition: header-pre.hxx:63
#define PQXX_PRIVATE
Definition: header-pre.hxx:206
Definition: connection.hxx:94
int row_size_type
Number of fields in a row of database data.
Definition: types.hxx:70
std::source_location sl
Convenience alias for std::source_location. It's just too long.
Definition: types.hxx:38
std::size_t field_size_type
Number of bytes in a field of database data.
Definition: types.hxx:76
encoding_group
Definition: encoding_group.hxx:40
int result_size_type
Number of rows in a result set.
Definition: types.hxx:64
unsigned int oid
PostgreSQL database row identifier.
Definition: types.hxx:60