lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::postgresql::Transaction Class Reference

#include <Transaction.h>

Public Member Functions

 Transaction (const Connection &tempConnection)
 
 Transaction (Transaction &transaction)=delete
 
void start ()
 
void commit ()
 
void save (const std::string &savepoint) const
 
void rollback ()
 
void rollbackTo (const std::string &savepoint) const
 
 ~Transaction ()
 

Detailed Description

Manages a PostgreSQL database transaction with commit, rollback, and savepoint support.

Constructor & Destructor Documentation

◆ Transaction() [1/2]

lintel::postgresql::Transaction::Transaction ( const Connection &  tempConnection)
explicit

Constructs a Transaction bound to the given connection.

Parameters
tempConnectionthe PostgreSQL connection

◆ Transaction() [2/2]

lintel::postgresql::Transaction::Transaction ( Transaction &  transaction)
delete

◆ ~Transaction()

lintel::postgresql::Transaction::~Transaction ( )

Destructor, rolls back if not finished.

Member Function Documentation

◆ commit()

void lintel::postgresql::Transaction::commit ( )

Commits the transaction with a COMMIT statement.

◆ rollback()

void lintel::postgresql::Transaction::rollback ( )

Rolls back the transaction with a ROLLBACK statement.

◆ rollbackTo()

void lintel::postgresql::Transaction::rollbackTo ( const std::string &  savepoint) const

Rolls back to a named savepoint.

Parameters
savepointthe savepoint name

◆ save()

void lintel::postgresql::Transaction::save ( const std::string &  savepoint) const

Creates a savepoint within the transaction.

Parameters
savepointthe savepoint name

◆ start()

void lintel::postgresql::Transaction::start ( )

Begins the transaction with a BEGIN statement.


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