Revision 01fe6db3
Von Christian Ehringfeld vor mehr als 8 Jahren hinzugefügt
src/database.h | ||
---|---|---|
#define DEFAULTMSGTYPE MsgType::CRITICAL
|
||
#endif
|
||
class Database {
|
||
private:
|
||
QSqlDatabase database;
|
||
QString connectionName;
|
||
bool supportTransactions;
|
||
Logger *logger = nullptr;
|
||
void init();
|
||
void initLogger(bool logQueries, bool logErrors, MsgType type);
|
||
bool logQueries;
|
||
bool logErrors;
|
||
|
||
public:
|
||
Database(QSqlDatabase database, bool logQueries = false, bool logErrors = true, MsgType type = DEFAULTMSGTYPE);
|
||
Database(QSqlDatabase database, bool logQueries = false, bool logErrors = true,
|
||
MsgType type = DEFAULTMSGTYPE);
|
||
~Database();
|
||
Database(QString databaseType, QString connectionName = QString(""),
|
||
QString hostname = QString(""),
|
||
... | ... | |
bool rollbackTransaction();
|
||
static DatabaseType getDatabaseType(QString s);
|
||
static Schema *getSchema(DatabaseType db,
|
||
QSharedPointer<Database> database);
|
||
QSharedPointer<Database> database);
|
||
Logger *getLogger() const;
|
||
private:
|
||
QSqlDatabase database;
|
||
QString connectionName;
|
||
bool supportTransactions;
|
||
Logger *logger = nullptr;
|
||
void init();
|
||
void initLogger(bool logQueries, bool logErrors, MsgType type);
|
||
bool logQueries;
|
||
bool logErrors;
|
||
};
|
||
}
|
||
#endif // DATABASE_H
|
Auch abrufbar als: Unified diff
included license texts, completed for new query builder test