Akonadi

dbconfigpostgresql.h
1 /*
2  SPDX-FileCopyrightText: 2010 Tobias Koenig <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef DBCONFIGPOSTGRESQL_H
8 #define DBCONFIGPOSTGRESQL_H
9 
10 #include "dbconfig.h"
11 
12 #include <optional>
13 
14 namespace Akonadi
15 {
16 namespace Server
17 {
18 
19 class DbConfigPostgresql : public DbConfig
20 {
21 public:
22  DbConfigPostgresql();
23 
27  QString driverName() const override;
28 
32  QString databaseName() const override;
33 
41  bool init(QSettings &settings, bool storeSettings = true) override;
42 
48  bool isAvailable(QSettings &settings) override;
49 
54  void apply(QSqlDatabase &database) override;
55 
59  bool useInternalServer() const override;
60 
64  bool startInternalServer() override;
65 
69  void stopInternalServer() override;
70 
71 protected:
72  QStringList postgresSearchPaths(const QString &versionedPath) const;
73 
74 private:
75  struct Versions {
76  int clusterVersion = 0;
77  int pgServerVersion = 0;
78  };
79  std::optional<Versions> checkPgVersion() const;
80  bool upgradeCluster(int clusterVersion);
81  bool runInitDb(const QString &dbDataPath);
82 
83  bool checkServerIsRunning();
84 
85  QString mDatabaseName;
86  QString mHostName;
87  int mHostPort;
88  QString mUserName;
89  QString mPassword;
90  QString mConnectionOptions;
91  QString mServerPath;
92  QString mInitDbPath;
93  QString mPgData;
94  QString mPgUpgradePath;
95  bool mInternalServer;
96 };
97 
98 } // namespace Server
99 } // namespace Akonadi
100 
101 #endif
QCA_EXPORT void init()
Helper integration between Akonadi and Qt.
KGuiItem apply()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 07:17:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.