Sqlite: Improve transaction by inversion of control

Using a callable makes it possible to omit the commit call. It is now
called by the withDeferredTransaction and withImmediateTransaction
function.

Change-Id: I9b7bfa7e32f269fe8fcba2fe5e1218e73f5846d1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
Marco Bubke
2023-05-21 13:23:26 +02:00
parent c9649513d1
commit be824148be
8 changed files with 302 additions and 237 deletions

View File

@@ -8,6 +8,7 @@
SqliteReadStatementMockBase::SqliteReadStatementMockBase(Utils::SmallStringView sqlStatement,
SqliteDatabaseMock &databaseMock)
: sqlStatement(sqlStatement)
, databaseMock(databaseMock)
{
databaseMock.prepare(sqlStatement);
}