Debian Codegraph @

src/librssguard/database/databasefactory.h

raw symbols SCIP
1 // For license of this file, see <project-root-folder>/LICENSE.md.
2
3 #ifndef DATABASEFACTORY_H
4 #define DATABASEFACTORY_H
5
6 #include "database/databasedriver.h"
7
8 #include <QObject>
9 #include <QSqlDatabase>
10
11 class RSSGUARD_DLLSPEC DatabaseFactory : public QObject {
12 Q_OBJECT
13
14 public:
15 explicit DatabaseFactory(QObject* parent = nullptr);
16
17 // Removes connection.
18 void removeConnection(const QString& connection_name = {});
19
20 // Returns identification of currently active database driver.
21 DatabaseDriver::DriverType activeDatabaseDriver() const;
22
23 DatabaseDriver* driver() const;
24 DatabaseDriver* driverForType(DatabaseDriver::DriverType d) const;
25
26 static QString lastExecutedQuery(const QSqlQuery& query);
27 static QString escapeQuery(const QString& query);
28
29 private:
30 void determineDriver();
31
32 QList<DatabaseDriver*> m_allDbDrivers;
33 DatabaseDriver* m_dbDriver;
34 };
35
36 #endif // DATABASEFACTORY_H