this is a helper class to handle transaction savepoints within SQLite
More...
#include <savepoint.hpp>
|
| | savepoint (connection &con, std::string const &name) |
| | constructor
|
| | ~savepoint () |
| | destructor
|
| void | release () |
| | Releases a previously created savepoint.
|
| void | rollback () |
| | Roll the database status back to the position of the current saveopint.
|
| bool | isActive () const |
| | Allow to check if savepoint handled by this object is currently active.
|
| std::string | getName () const |
| | Returns a string containing the current savepoint name.
|
| snapshot | take_snapshot (std::string_view schema="main") |
| void | open_snapshot (snapshot const &snap, std::string_view schema="main") |
|
| void | exec (std::string const &) |
this is a helper class to handle transaction savepoints within SQLite
Definition at line 52 of file savepoint.hpp.
◆ savepoint()
| sqlite::v2::savepoint::savepoint |
( |
connection & | con, |
|
|
std::string const & | name ) |
constructor
- Parameters
-
| con | a reference to the connection object where the transaction should be started/ended/committed or rolled back |
| name | alias for the savepoint |
◆ ~savepoint()
| sqlite::v2::savepoint::~savepoint |
( |
| ) |
|
◆ exec()
| void sqlite::v2::savepoint::exec |
( |
std::string const & | | ) |
|
|
private |
◆ getName()
| std::string sqlite::v2::savepoint::getName |
( |
| ) |
const |
|
inline |
Returns a string containing the current savepoint name.
- Returns
- The alias of savepoint handled by this object
Definition at line 91 of file savepoint.hpp.
References m_name.
◆ isActive()
| bool sqlite::v2::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 84 of file savepoint.hpp.
References m_isActive.
◆ open_snapshot()
| void sqlite::v2::savepoint::open_snapshot |
( |
snapshot const & | snap, |
|
|
std::string_view | schema = "main" ) |
◆ release()
| void sqlite::v2::savepoint::release |
( |
| ) |
|
Releases a previously created savepoint.
◆ rollback()
| void sqlite::v2::savepoint::rollback |
( |
| ) |
|
Roll the database status back to the position of the current saveopint.
◆ take_snapshot()
| snapshot sqlite::v2::savepoint::take_snapshot |
( |
std::string_view | schema = "main" | ) |
|
◆ m_con
◆ m_isActive
| bool sqlite::v2::savepoint::m_isActive |
|
private |
if true the savepoint with alias m_name is still active (not currently released)
Definition at line 103 of file savepoint.hpp.
Referenced by isActive().
◆ m_name
| std::string sqlite::v2::savepoint::m_name |
|
private |
The documentation for this struct was generated from the following file: