#pragma once

#include <QSqlDatabase>
#include <QString>
#include <QMutex>

class DatabaseManager
{
public:
    static DatabaseManager& instance();
    ~DatabaseManager();

    bool initialize(const QString& databasePath = QStringLiteral("wino-mail.sqlite"));
    QSqlDatabase& database();

private:
    DatabaseManager();
    Q_DISABLE_COPY(DatabaseManager)

    QSqlDatabase m_db;
    QMutex m_mutex;
    bool m_initialized{false};
};