@@ -18780,31 +18780,39 @@ namespace sqlite_orm {
1878018780 limit_accessor limit;
1878118781
1878218782 transaction_guard_t transaction_guard() {
18783- this->begin_transaction();
18784- return {this->get_connection(),
18785- std::bind(&storage_base::commit, this),
18786- std::bind(&storage_base::rollback, this)};
18783+ auto connection = this->get_connection();
18784+ sqlite3* db = connection.get();
18785+ this->executor.perform_void_exec(db, "BEGIN TRANSACTION");
18786+ return {std::move(connection),
18787+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "COMMIT"),
18788+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "ROLLBACK")};
1878718789 }
1878818790
1878918791 transaction_guard_t deferred_transaction_guard() {
18790- this->begin_deferred_transaction();
18791- return {this->get_connection(),
18792- std::bind(&storage_base::commit, this),
18793- std::bind(&storage_base::rollback, this)};
18792+ auto connection = this->get_connection();
18793+ sqlite3* db = connection.get();
18794+ this->executor.perform_void_exec(db, "BEGIN DEFERRED TRANSACTION");
18795+ return {std::move(connection),
18796+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "COMMIT"),
18797+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "ROLLBACK")};
1879418798 }
1879518799
1879618800 transaction_guard_t immediate_transaction_guard() {
18797- this->begin_immediate_transaction();
18798- return {this->get_connection(),
18799- std::bind(&storage_base::commit, this),
18800- std::bind(&storage_base::rollback, this)};
18801+ auto connection = this->get_connection();
18802+ sqlite3* db = connection.get();
18803+ this->executor.perform_void_exec(db, "BEGIN IMMEDIATE TRANSACTION");
18804+ return {std::move(connection),
18805+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "COMMIT"),
18806+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "ROLLBACK")};
1880118807 }
1880218808
1880318809 transaction_guard_t exclusive_transaction_guard() {
18804- this->begin_exclusive_transaction();
18805- return {this->get_connection(),
18806- std::bind(&storage_base::commit, this),
18807- std::bind(&storage_base::rollback, this)};
18810+ auto connection = this->get_connection();
18811+ sqlite3* db = connection.get();
18812+ this->executor.perform_void_exec(db, "BEGIN EXCLUSIVE TRANSACTION");
18813+ return {std::move(connection),
18814+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "COMMIT"),
18815+ std::bind(&sqlite_executor::perform_void_exec, &executor, db, "ROLLBACK")};
1880818816 }
1880918817
1881018818 /**
@@ -19328,19 +19336,23 @@ namespace sqlite_orm {
1932819336 }
1932919337
1933019338 void begin_transaction() {
19331- this->begin_transaction_internal("BEGIN TRANSACTION");
19339+ sqlite3* db = this->connection->retain();
19340+ this->executor.perform_void_exec(db, "BEGIN TRANSACTION");
1933219341 }
1933319342
1933419343 void begin_deferred_transaction() {
19335- this->begin_transaction_internal("BEGIN DEFERRED TRANSACTION");
19344+ sqlite3* db = this->connection->retain();
19345+ this->executor.perform_void_exec(db, "BEGIN DEFERRED TRANSACTION");
1933619346 }
1933719347
1933819348 void begin_immediate_transaction() {
19339- this->begin_transaction_internal("BEGIN IMMEDIATE TRANSACTION");
19349+ sqlite3* db = this->connection->retain();
19350+ this->executor.perform_void_exec(db, "BEGIN IMMEDIATE TRANSACTION");
1934019351 }
1934119352
1934219353 void begin_exclusive_transaction() {
19343- this->begin_transaction_internal("BEGIN EXCLUSIVE TRANSACTION");
19354+ sqlite3* db = this->connection->retain();
19355+ this->executor.perform_void_exec(db, "BEGIN EXCLUSIVE TRANSACTION");
1934419356 }
1934519357
1934619358 void commit() {
@@ -19502,12 +19514,6 @@ namespace sqlite_orm {
1950219514 }
1950319515 }
1950419516
19505- void begin_transaction_internal(const std::string& sql) {
19506- this->connection->retain();
19507- sqlite3* db = this->connection->get();
19508- this->executor.perform_void_exec(db, sql.c_str());
19509- }
19510-
1951119517 connection_ref get_connection() {
1951219518 return {*this->connection};
1951319519 }
0 commit comments