YATiSh
Yet Another TIme SHeet
yatishDBmysql.h
Go to the documentation of this file.
1 /********************************************************************
2  * Name: yatishDBmysql.h
3  * Purpose: Declares a mysql controller
4  * Author: Nicolas PĂ©renne (nicolas.perenne@eif-services.eu)
5  * Created: 2020-04-16
6  * Copyright: EIF-services (https://www.eif-services.eu/yatish)
7  * License: GPLv3
8  ********************************************************************/
9 
10 #ifndef YATISHDBMYSQL_H
11 #define YATISHDBMYSQL_H
12 
13 #include "yatishDB.h"
14 
18 class yatishDBmysql : public yatishDB {
19  public:
20  yatishDBmysql ();
21  ~yatishDBmysql ();
22  bool IsOk () { return slaveDB != nullptr; }
23  int Commit ();
24  int Upload ();
25  int Download ();
26  private:
27  static wxDatabase * slaveDB;
28  int errorCode;
29  bool NewTables ();
30  bool EmptySlaveTables ();
31  bool EmptyMasterTables ();
32  bool OutdateMasterTables ();
33  bool Delete ();
34  bool Insert ();
35  bool InsertProject ();
36  bool InsertActivity ();
37  bool InsertTimeslot ();
38  bool Update ();
39  bool UpdateProject ();
40  bool UpdateActivity ();
41  bool UpdateTimeslot ();
42  bool DownloadNames ();
43  bool DownloadProject ();
44  bool DownloadActivity ();
45  bool DownloadTimeslot ();
46 };
47 
48 #endif // YATISHDBMYSQL_H
Provides a few basic methods and (static) members to interact with yatish tables.
Definition: yatishDB.h:42
Interacts with yatish tables in a MySQL/MariaDB database.
Definition: yatishDBmysql.h:18
int Download()
Downloads slaveDB into masterDB.
bool UpdateTimeslot()
Takes care of UPDATEs in yatish_timeslot.
bool Insert()
Takes care of INSERTs in yatish tables with a single name column.
bool DownloadProject()
Downloads yatish_project.
bool InsertActivity()
Takes care of INSERTs in yatish_activity.
bool DownloadNames()
Downloads yatish tables with a single name column.
bool UpdateProject()
Takes care of UPDATEs in yatish_project.
bool DownloadActivity()
Downloads yatish_activity.
bool EmptyMasterTables()
Empties all yatish tables in masterDB.
bool Delete()
Takes care of DELETEs in yatish tables.
bool EmptySlaveTables()
Empties all yatish tables in slaveDB.
bool NewTables()
Creates the yatish tables.
bool UpdateActivity()
Takes care of UPDATEs in yatish_activity.
bool InsertTimeslot()
Takes care of INSERTs in yatish_timeslot.
bool DownloadTimeslot()
Download yatish_timeslot.
bool OutdateMasterTables()
Sets the sync field to 'I' in all records of all yatish tables in masterDB.
bool Update()
Takes care of UPDATEs in yatish tables with a single name column.
yatishDBmysql()
Mainly connects to the MySQL database specified in yatish.auth
int Upload()
Uploads masterDB into slaveDB.
int Commit()
Updates slaveDB with records of masterDB where the sync field is not 'S'.
static wxDatabase * slaveDB
Definition: yatishDBmysql.h:27
bool InsertProject()
Takes care of INSERTs in yatish_project.