libpqxx
The C++ client library for PostgreSQL
connection-largeobject.hxx
Go to the documentation of this file.
1 #ifndef PQXX_INTERNAL_GATES_CONNECTION_LARGEOBJECT_HXX
2 #define PQXX_INTERNAL_GATES_CONNECTION_LARGEOBJECT_HXX
3 
4 #include <string>
5 
7 
8 namespace pqxx
9 {
10 class blob;
11 class largeobject;
12 } // namespace pqxx
13 
14 
15 namespace pqxx::internal::gate
16 {
17 class PQXX_PRIVATE connection_largeobject final : callgate<connection>
18 {
19  friend class pqxx::blob;
20  friend class pqxx::largeobject;
21 
22  explicit constexpr connection_largeobject(reference x) noexcept : super(x) {}
23 
24  PQXX_PURE [[nodiscard]] pq::PGconn *raw_connection() const noexcept
25  {
26  return home().raw_connection();
27  }
28 };
29 
30 
32  : callgate<connection const>
33 {
34  friend class pqxx::blob;
35  friend class pqxx::largeobject;
36 
37  explicit constexpr const_connection_largeobject(reference x) noexcept :
38  super(x)
39  {}
40 
41  [[nodiscard]] std::string error_message() const { return home().err_msg(); }
42 };
43 } // namespace pqxx::internal::gate
44 #endif
Definition: blob.hxx:44
Connection to a database.
Definition: connection.hxx:273
Base class for call gates.
Definition: callgate.hxx:55
connection const & reference
A reference to the host class. Helps keep constructors easy.
Definition: callgate.hxx:60
Definition: connection-largeobject.hxx:18
Definition: connection-largeobject.hxx:33
Identity of a large object.
Definition: largeobject.hxx:44
static PQXX_PURE internal::pq::PGconn * raw_connection(dbtransaction const &T)
Definition: largeobject.cxx:160
#define PQXX_PURE
Definition: header-pre.hxx:64
#define PQXX_PRIVATE
Definition: header-pre.hxx:207
Definition: connection.hxx:94
void PGconn
Placeholder for libpq's connection type.
Definition: types.hxx:429
The home of all libpqxx classes, functions, templates, etc.
Definition: array.cxx:26