libpqxx
|
Connection policy; creates an immediate connection to a database. More...
#include <connection.hxx>
Public Member Functions | |
connect_direct (const std::string &opts) | |
virtual handle | do_startconnect (handle) override |
Public Member Functions inherited from pqxx::connectionpolicy | |
connectionpolicy (const std::string &opts) | |
virtual | ~connectionpolicy () noexcept |
const std::string & | options () const noexcept |
virtual handle | do_completeconnect (handle orig) |
virtual handle | do_dropconnect (handle orig) noexcept |
virtual handle | do_disconnect (handle orig) noexcept |
virtual bool | is_ready (handle) const noexcept |
Additional Inherited Members | |
Public Types inherited from pqxx::connectionpolicy | |
using | handle = internal::pq::PGconn * |
Protected Member Functions inherited from pqxx::connectionpolicy | |
handle | normalconnect (handle) |
Connection policy; creates an immediate connection to a database.
This is the policy you typically need when you work with a database through libpqxx. It connects to the database immediately. Another option is to defer setting up the underlying connection to the database until it's actually needed; the connect_lazy policy implements such "lazy" * behaviour.
The advantage of having an "immediate" connection (as this policy gives you) is that any errors in setting up the connection will occur during construction of the connection object, rather than at some later point further down your program.
|
explicit |
The parsing of options is the same as in libpq's PQconnect. See: https://www.postgresql.org/docs/10/static/libpq-connect.html
|
overridevirtual |
Reimplemented from pqxx::connectionpolicy.
References pqxx::connectionpolicy::do_disconnect(), and pqxx::connectionpolicy::normalconnect().