pg_async
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tip::db::pg::connection_options Struct Reference

Postgre connection options. More...

#include <common.hpp>

Collaboration diagram for tip::db::pg::connection_options:
Collaboration graph
[legend]

Public Member Functions

void generate_alias ()
 

Static Public Member Functions

static connection_options parse (std::string const &)
 

Public Attributes

dbalias alias
 
std::string schema
 
std::string uri
 
std::string database
 
std::string user
 
std::string password
 

Detailed Description

Postgre connection options.

Definition at line 250 of file common.hpp.

Member Function Documentation

void tip::db::pg::connection_options::generate_alias ( )

Generate an alias from username, database and uri if the alias was not provided.

static connection_options tip::db::pg::connection_options::parse ( std::string const &  )
static

Parse a connection string

// Full options for a TCP connection
connection_options opts = "aliasname=tcp://user:password@localhost:5432[database]"_pg;
// SSL connection over TCP
opts = "ssl://localhost:5432[database]"_pg;
// Connection via UNIX socket
opts = "socket:///tmp/.s.PGSQL.5432[database]"_pg;
See Also
connstring

Member Data Documentation

dbalias tip::db::pg::connection_options::alias

Database alias

Definition at line 251 of file common.hpp.

std::string tip::db::pg::connection_options::database

Database name

Definition at line 254 of file common.hpp.

std::string tip::db::pg::connection_options::password

Database user's password

Definition at line 256 of file common.hpp.

std::string tip::db::pg::connection_options::schema

Database connection schema. Currently supported are tcp and socket

Definition at line 252 of file common.hpp.

std::string tip::db::pg::connection_options::uri

Database connection uri. host:port for tcp, /path/to/file for socket

Definition at line 253 of file common.hpp.

std::string tip::db::pg::connection_options::user

Database user name

Definition at line 255 of file common.hpp.


The documentation for this struct was generated from the following file: