aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/sqlite/sqlitedatabaseinterface.h
blob: e26b471709be943137600a0c533c5183c5116597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/smallstringvector.h>

#include "sourcelocation.h"
#include "sqliteglobal.h"

namespace Sqlite {
class DatabaseInterface
{
public:
    virtual void walCheckpointFull(const source_location &sourceLocation = source_location::current()) = 0;
    virtual void execute(Utils::SmallStringView sqlStatement,
                         const source_location &sourceLocation = source_location::current())
        = 0;
    virtual void setUpdateHook(
        void *object,
        void (*)(void *object, int, char const *database, char const *, long long rowId))
        = 0;
    virtual void resetUpdateHook() = 0;
    virtual void applyAndUpdateSessions() = 0;
    virtual void setAttachedTables(const Utils::SmallStringVector &tables) = 0;

protected:
    ~DatabaseInterface() = default;
};
} // namespace Sqlite