openPilotLog

adatabasesetup.h
1 /*
2 *openPilot Log - A FOSS Pilot Logbook Application
3 *Copyright (C) 2020 Felix Turowsky
4 *
5 *This program is free software: you can redistribute it and/or modify
6 *it under the terms of the GNU General Public License as published by
7 *the Free Software Foundation, either version 3 of the License, or
8 *(at your option) any later version.
9 *
10 *This program is distributed in the hope that it will be useful,
11 *but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *GNU General Public License for more details.
14 *
15 *You should have received a copy of the GNU General Public License
16 *along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18 #ifndef DBSETUP_H
19 #define DBSETUP_H
20
21 #include <QCoreApplication>
22 #include "src/database/db.h"
23 #include "src/database/dbinfo.h"
24 #include "src/functions/areadcsv.h"
25
32 class ADataBaseSetup
33 {
34 public:
35 static void debug();
36
37 static bool createDatabase();
38
39 static bool fillTemplates();
40
41 static bool importDefaultData();
42
43 static bool resetToDefault();
44
45 static bool commitData(QVector<QStringList> fromCSV, const QString &tableName);
46
47 private:
48
49 static bool createSchemata(const QStringList &statements);
50
51
52 };
53
54 #endif // DBSETUP_H
ADataBaseSetup::commitData
static bool commitData(QVector< QStringList > fromCSV, const QString &tableName)
DbSetup::commitData inserts the data parsed from a csv file into the database. The first line of the ...
Definition: adatabasesetup.cpp:379
ADataBaseSetup::resetToDefault
static bool resetToDefault()
DbSetup::resetToDefault Empties all user-generated content in the database.
Definition: adatabasesetup.cpp:306
ADataBaseSetup::debug
static void debug()
dbSetup::debug prints Database Layout
Definition: adatabasesetup.cpp:323
ADataBaseSetup
The ADataBaseSetup class is responsible for the inital setup of the database when the application is ...
Definition: adatabasesetup.h:33