|
libpqxx
The C++ client library for PostgreSQL
|
#include <cstddef>#include <ctime>#include <functional>#include <initializer_list>#include <list>#include <map>#include <memory>#include <string_view>#include <tuple>#include <utility>#include "pqxx/errorhandler.hxx"#include "pqxx/except.hxx"#include "pqxx/internal/concat.hxx"#include "pqxx/params.hxx"#include "pqxx/separated_list.hxx"#include "pqxx/strconv.hxx"#include "pqxx/types.hxx"#include "pqxx/util.hxx"#include "pqxx/zview.hxx"#include "pqxx/internal/ignore-deprecated-pre.hxx"#include "pqxx/internal/ignore-deprecated-post.hxx"Go to the source code of this file.
Classes | |
| struct | pqxx::notification |
| An incoming notification. More... | |
| class | pqxx::connection |
| Connection to a database. More... | |
| class | pqxx::connecting |
| An ongoing, non-blocking stepping stone to a connection. More... | |
Namespaces | |
| pqxx::internal | |
| Internal items for libpqxx' own use. Do not use these yourself. | |
| pqxx::internal::gate | |
| pqxx | |
| The home of all libpqxx classes, functions, templates, etc. | |
Typedefs | |
| using | pqxx::table_path = std::initializer_list< std::string_view > |
| Representation of a PostgreSQL table path. More... | |
| using | pqxx::connection_base = connection |
Enumerations | |
| enum | pqxx::skip_init : int { pqxx::nothing, pqxx::openssl, pqxx::crypto } |
| Flags for skipping initialisation of SSL-related libraries. More... | |
| enum | pqxx::error_verbosity : int { pqxx::error_verbosity::terse = 0, pqxx::error_verbosity::normal = 1, pqxx::error_verbosity::verbose = 2 } |
| Error verbosity levels. More... | |
Functions | |
| void PQXX_COLD PQXX_LIBEXPORT | pqxx::internal::skip_init_ssl (int skips) noexcept |
| Control OpenSSL/crypto library initialisation. More... | |
| template<skip_init... SKIP> | |
| void | pqxx::skip_init_ssl () noexcept |
| Control initialisation of OpenSSL and libcrypto libraries. More... | |
| std::string PQXX_LIBEXPORT | pqxx::encrypt_password (char const user[], char const password[]) |
| Encrypt a password. More... | |
| std::string | pqxx::encrypt_password (zview user, zview password) |
| Encrypt password. More... | |
| struct pqxx::notification |
An incoming notification.
PostgreSQL extends SQL with a "message bus" using the LISTEN and NOTIFY commands. In libpqxx you use connection::listen() and (optionally) transaction_base::notify().
When you receive a notification for which you have been listening, your handler receives it in the form of a notification object.
| Class Members | ||
|---|---|---|
| int | backend_pid |
Process ID of the backend that sent the notification. This can be useful in situations where a multiple clients are listening on the same channel, and also send notifications on it. In those situations, it often makes sense for a client to ignore its own incoming notifications, but handle all others on the same channel in some way. To check for that, compare this process ID to the return value of the connection's |
| zview | channel |
Channel name. The notification logic will only pass the notification to a handler which was registered to listen on this exact name. |
| connection & | conn |
The connection which received the notification. There will be no backend transaction active on the connection when your handler gets called, but there may be a nontransaction. (This is a special transaction type in libpqxx which does not start a transaction on the backend.) |
| zview | payload |
Optional payload text. If the notification did not carry a payload, the string will be empty. |