kasts/src/database.h

36 lines
680 B
C
Raw Normal View History

2020-03-16 22:37:04 +01:00
/**
2020-08-14 20:56:04 +02:00
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
2021-04-08 13:16:36 +02:00
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
2020-03-16 22:37:04 +01:00
*
2020-08-14 20:56:04 +02:00
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
2020-03-16 22:37:04 +01:00
*/
#pragma once
#include <QSqlQuery>
2020-05-26 16:32:07 +02:00
class Database : public QObject
2020-03-16 22:37:04 +01:00
{
2020-05-26 16:32:07 +02:00
Q_OBJECT
2020-03-16 22:37:04 +01:00
public:
static Database &instance()
{
static Database _instance;
return _instance;
}
bool execute(QSqlQuery &query);
2020-11-01 13:18:11 +01:00
bool execute(const QString &query);
2020-03-16 22:37:04 +01:00
private:
Database();
int version();
bool migrate();
bool migrateTo1();
bool migrateTo2();
bool migrateTo3();
bool migrateTo4();
void cleanup();
2020-03-16 22:37:04 +01:00
};