Files
qt-creator/tests/unit/unittest/sqlitereadstatementmock.cpp
Marco Bubke be824148be 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>
2023-05-22 10:07:40 +00:00

15 lines
504 B
C++

// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "sqlitereadstatementmock.h"
#include "sqlitedatabasemock.h"
SqliteReadStatementMockBase::SqliteReadStatementMockBase(Utils::SmallStringView sqlStatement,
SqliteDatabaseMock &databaseMock)
: sqlStatement(sqlStatement)
, databaseMock(databaseMock)
{
databaseMock.prepare(sqlStatement);
}