VSQLite++ 0.3
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sqlite::savepoint Struct Reference

this is a helper class to handle transaction savepoints within SQLite More...

#include <savepoint.hpp>

Collaboration diagram for sqlite::savepoint:
Collaboration graph

Public Member Functions

 savepoint (connection &con, std::string const &name)
 constructor More...
 
 ~savepoint ()
 destructor More...
 
void release ()
 Releases a previously created savepoint. More...
 
void rollback ()
 Roll the database status back to the position of the current saveopint. More...
 
bool isActive () const
 Allow to check if savepoint handled by this object is currently active. More...
 
std::string getName () const
 Returns a string containing the current savepoint name. More...
 

Private Member Functions

void exec (std::string const &)
 

Private Attributes

connectionm_con
 SQlite connection handler. More...
 
std::string m_name
 The alias for the savepoint. More...
 
bool m_isActive
 if true the savepoint with alias m_name is still active (not currently released) More...
 

Detailed Description

this is a helper class to handle transaction savepoints within SQLite

Definition at line 42 of file savepoint.hpp.

Constructor & Destructor Documentation

◆ savepoint()

sqlite::savepoint::savepoint ( connection con,
std::string const &  name 
)

constructor

Parameters
cona reference to the connection object where the transaction should be started/ended/committed or rolled back
namealias for the savepoint

◆ ~savepoint()

sqlite::savepoint::~savepoint ( )

destructor

Member Function Documentation

◆ exec()

void sqlite::savepoint::exec ( std::string const &  )
private

◆ getName()

std::string sqlite::savepoint::getName ( ) const
inline

Returns a string containing the current savepoint name.

Returns
The alias of savepoint handled by this object

Definition at line 79 of file savepoint.hpp.

References m_name.

◆ isActive()

bool sqlite::savepoint::isActive ( ) const
inline

Allow to check if savepoint handled by this object is currently active.

Note
This dues not make any checks inside SQlite's internal data so if a previously-made savepoint is alredy released or rollbacked (committing or rollbacking also this one) this method will continue to say that the savepoint is active.
Returns
true if savepoint is still active, false otherwise

Definition at line 74 of file savepoint.hpp.

References m_isActive.

◆ release()

void sqlite::savepoint::release ( )

Releases a previously created savepoint.

◆ rollback()

void sqlite::savepoint::rollback ( )

Roll the database status back to the position of the current saveopint.

Member Data Documentation

◆ m_con

connection& sqlite::savepoint::m_con
private

SQlite connection handler.

Definition at line 83 of file savepoint.hpp.

◆ m_isActive

bool sqlite::savepoint::m_isActive
private

if true the savepoint with alias m_name is still active (not currently released)

Definition at line 85 of file savepoint.hpp.

Referenced by isActive().

◆ m_name

std::string sqlite::savepoint::m_name
private

The alias for the savepoint.

Definition at line 84 of file savepoint.hpp.

Referenced by getName().


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