kasts/src/database.h
Bart De Vries 49977adc38 Refactor Error implementation and add Error::Type
- 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)
2021-06-19 17:09:44 +02:00

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();
};