forked from ondra/colnod-connector
39 lines
724 B
C++
39 lines
724 B
C++
#ifndef DATABASEMANAGER_H
|
|
#define DATABASEMANAGER_H
|
|
#include <QSql>
|
|
#include <QSqlDatabase>
|
|
#include <QSqlQuery>
|
|
#include <QSqlError>
|
|
|
|
#include <QVariant>
|
|
#include <QDebug>
|
|
#include "subject.h"
|
|
#include "token.h"
|
|
|
|
|
|
class DatabaseManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DatabaseManager(QString host, QString dbName, QString user, QString password);
|
|
|
|
void saveSubject(Subject* subject, QString table);
|
|
void saveToken(Token* token, QString table);
|
|
|
|
QString getTestMessage(int id);
|
|
void createTestRecord(QString msg);
|
|
|
|
|
|
bool getOpened() {return opened;}
|
|
|
|
private:
|
|
QSqlDatabase db;
|
|
QSqlQuery query;
|
|
|
|
bool opened;
|
|
|
|
|
|
};
|
|
|
|
#endif // DATABASEMANAGER_H
|