mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-05 20:50:34 -06:00
Add is_transaction_active() to all connectors (#550)
* Document the connector API method is_transaction_active() * Move mysql::connection_base::is_transaction_active() to the other transaction-handling methods. * Add more tests for mysql::connection::is_transaction_active() * Add postgresql::connection_base::is_transaction_active() * Add tests for postgresql::connection_base::is_transaction_active() * Change the type of the SQLite3 transaction status from transaction_status_type to a boolean flag. * Add sqlite3::connection_base::is_transaction_active() * Add tests for sqlite3::connection_base::is_transaction_active() * When closing a transaction do it in the following order: report (if any), execute SQL command, set transaction active flag to false.
This commit is contained in:
@@ -55,6 +55,7 @@ int MoveConstructor(int, char*[])
|
||||
gamma bool DEFAULT NULL
|
||||
))");
|
||||
|
||||
assert(connections.at(0).is_transaction_active() == false);
|
||||
connections.at(0).start_transaction();
|
||||
auto db = std::move(connections.at(0));
|
||||
assert(db.is_transaction_active());
|
||||
@@ -74,6 +75,7 @@ int MoveConstructor(int, char*[])
|
||||
std::cerr << "row.alpha: " << row.alpha << ", row.beta: " << row.at("beta") << std::endl;
|
||||
};
|
||||
db.commit_transaction();
|
||||
assert(db.is_transaction_active() == false);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user