pg_async
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
tip::db::pg::transaction Class Reference

RAII transaction object. More...

#include <transaction.hpp>

Inheritance diagram for tip::db::pg::transaction:
Inheritance graph
[legend]
Collaboration diagram for tip::db::pg::transaction:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr
< basic_connection > 
connection_ptr
 
typedef basic_connection * pointer
 
typedef basic_connection const * const_pointer
 

Public Member Functions

 transaction (connection_ptr)
 
 ~transaction ()
 
 transaction (transaction const &)=delete
 
transactionoperator= (transaction const &)=delete
 
 transaction (transaction &&)=delete
 
transactionoperator= (transaction &&)=delete
 
dbalias const & alias () const
 
bool in_transaction () const
 
void commit ()
 
void rollback ()
 
void execute (std::string const &query, query_result_callback, query_error_callback)
 
void execute (std::string const &query, type_oid_sequence const &param_types, std::vector< byte > params_buffer, query_result_callback, query_error_callback)
 
pointer operator-> ()
 
const_pointer operator-> () const
 
pointer operator* ()
 
const_pointer operator* () const
 

Detailed Description

RAII transaction object.

It is created by the library internally when a transaction is started. It will rollback the transaction if it wasn't explicitly committed.

Warning
A tip::db::pg::transaction object shoudn't be stored and accessed concurrently.

Definition at line 29 of file transaction.hpp.

Member Typedef Documentation

typedef std::shared_ptr<basic_connection> tip::db::pg::transaction::connection_ptr

Definition at line 31 of file transaction.hpp.

typedef basic_connection const* tip::db::pg::transaction::const_pointer

Definition at line 33 of file transaction.hpp.

typedef basic_connection* tip::db::pg::transaction::pointer

Definition at line 32 of file transaction.hpp.

Constructor & Destructor Documentation

tip::db::pg::transaction::transaction ( connection_ptr  )
tip::db::pg::transaction::~transaction ( )
tip::db::pg::transaction::transaction ( transaction const &  )
delete
tip::db::pg::transaction::transaction ( transaction &&  )
delete

Member Function Documentation

dbalias const& tip::db::pg::transaction::alias ( ) const
void tip::db::pg::transaction::commit ( )
void tip::db::pg::transaction::execute ( std::string const &  query,
query_result_callback  ,
query_error_callback   
)
void tip::db::pg::transaction::execute ( std::string const &  query,
type_oid_sequence const &  param_types,
std::vector< byte params_buffer,
query_result_callback  ,
query_error_callback   
)
bool tip::db::pg::transaction::in_transaction ( ) const
pointer tip::db::pg::transaction::operator* ( )
inline

Definition at line 59 of file transaction.hpp.

const_pointer tip::db::pg::transaction::operator* ( ) const
inline

Definition at line 64 of file transaction.hpp.

pointer tip::db::pg::transaction::operator-> ( )
inline

Access to underlying connection object

Definition at line 48 of file transaction.hpp.

const_pointer tip::db::pg::transaction::operator-> ( ) const
inline

Definition at line 53 of file transaction.hpp.

transaction& tip::db::pg::transaction::operator= ( transaction const &  )
delete
transaction& tip::db::pg::transaction::operator= ( transaction &&  )
delete
void tip::db::pg::transaction::rollback ( )

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