mirror of
https://github.com/KDE/kasts.git
synced 2025-01-09 15:22:33 +01:00
49977adc38
- This refactoring also includes a cleanup of a lot of header includes to avoid circular dependencies. - The error message will now be shown below the info message. - Add database migration (for Errors)
34 lines
634 B
C++
34 lines
634 B
C++
/**
|
|
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
|
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QSqlQuery>
|
|
|
|
class Database : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static Database &instance()
|
|
{
|
|
static Database _instance;
|
|
return _instance;
|
|
}
|
|
bool execute(QSqlQuery &query);
|
|
bool execute(const QString &query);
|
|
|
|
private:
|
|
Database();
|
|
int version();
|
|
|
|
bool migrate();
|
|
bool migrateTo1();
|
|
bool migrateTo2();
|
|
void cleanup();
|
|
};
|