Nut  0.1
 All Classes Functions
database_p.h
1 /**************************************************************************
2 **
3 ** This file is part of Nut project.
4 ** https://github.com/HamedMasafi/Nut
5 **
6 ** Nut is free software: you can redistribute it and/or modify
7 ** it under the terms of the GNU Lesser General Public License as published by
8 ** the Free Software Foundation, either version 3 of the License, or
9 ** (at your option) any later version.
10 **
11 ** Nut is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU Lesser General Public License for more details.
15 **
16 ** You should have received a copy of the GNU Lesser General Public License
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
18 **
19 **************************************************************************/
20 
21 #ifndef DATABASE_P_H
22 #define DATABASE_P_H
23 
24 #include "database.h"
25 #include "databasemodel.h"
26 #include "changelogtable.h"
27 
28 #include <QDebug>
29 
30 QT_BEGIN_NAMESPACE
31 
33 {
34  Database *q_ptr;
35  Q_DECLARE_PUBLIC(Database)
36 
37 public:
38  DatabasePrivate(Database *parent);
39 
40 
41  bool open();
42 
43  bool updateDatabase();
44  void createChangeLogs();
45  bool storeScheemaInDB();
46  DatabaseModel getLastScheema();
47  QVariantMap getCurrectScheema();
48 
49  QSqlDatabase db;
50 
51  QString hostName;
52  QString databaseName;
53  int port;
54  QString userName;
55  QString password;
56  QString connectionName;
57  QString driver;
58 
59  QHash<QString, QString> tables;
60 
61  SqlGeneratorBase *sqlGenertor;
62  DatabaseModel currentModel;
63 
64  TableSet<ChangeLogTable> *changeLogs;
65 };
66 
67 QT_END_NAMESPACE
68 
69 #endif // DATABASE_P_H