# pqxx::connect_direct Class Reference
[Connection classes]

Connection policy; creates an immediate connection to a database. More...

`#include <connection.hxx>`

Inheritance diagram for pqxx::connect_direct:

[legend]

List of all members.

## Public Member Functions
| connect_direct (const std::string &opts)
virtual handle | do_startconnect (handle)

## Detailed Description

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.

## Constructor & Destructor Documentation

pqxx::connect_direct::connect_direct | ( | const std::string & | opts | ) | `[explicit]`

## Member Function Documentation

pqxx::connectionpolicy::handle pqxx::connect_direct::do_startconnect | ( | handle | orig | ) | `[virtual]`

Reimplemented from pqxx::connectionpolicy.

References pqxx::connectionpolicy::do_disconnect(), and pqxx::connectionpolicy::normalconnect().

The documentation for this class was generated from the following files:

- connection.hxx
- connection.cxx