YATISH
Yet Another TIme SHeet
/home/nicolas/sources/yatish/yatishDBmysql.h
Go to the documentation of this file.
1 /***************************************************************
2  * Name: yatishDBmysql.h
3  * Purpose: Defines 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)
7  * License: GPLv3
8  **************************************************************/
9 
10 #ifndef YATISHDBMYSQL_H
11 #define YATISHDBMYSQL_H
12 
13 #include <wx/listctrl.h>
14 #include "yatishDB.h"
15 
19 class yatishDBmysql : public yatishDB {
20  public:
21  yatishDBmysql ();
22  ~yatishDBmysql ();
23  bool IsOk () { return slaveDB != nullptr; }
24  int Commit ();
25  int Upload ();
26  int Download ();
27  private:
28  static wxDatabase * slaveDB;
29  int errorCode;
30  bool NewTables ();
31  bool EmptySlaveTables ();
32  bool EmptyMasterTables ();
33  bool OutdateMasterTables ();
34  bool Delete ();
35  bool Insert ();
36  bool InsertProject ();
37  bool InsertActivity ();
38  bool InsertTimeslot ();
39  bool Update ();
40  bool UpdateProject ();
41  bool UpdateActivity ();
42  bool UpdateTimeslot ();
43  bool DownloadNames ();
44  bool DownloadProject ();
45  bool DownloadActivity ();
46  bool DownloadTimeslot ();
47 };
48 
49 #endif // YATISHDBMYSQL_H
bool EmptySlaveTables()
Empties all yatish tables in slaveDB.
bool Delete()
Takes care of DELETEs in yatish tables.
Interacts with yatish tables in a MySQL/MariaDB database.
Definition: yatishDBmysql.h:19
bool DownloadActivity()
Downloads yatish_activity.
bool DownloadProject()
Downloads yatish_project.
int Download()
Downloads slaveDB into masterDB.
bool UpdateTimeslot()
Takes care of UPDATEs in yatish_timeslot.
yatishDBmysql()
Mainly connects to the MySQL database specified in yatish.auth
bool InsertActivity()
Takes care of INSERTs in yatish_activity.
bool OutdateMasterTables()
Sets the sync field to &#39;I&#39; in all records of all yatish tables in masterDB.
bool Update()
Takes care of UPDATEs in yatish tables with a single name column.
bool InsertProject()
Takes care of INSERTs in yatish_project.
bool EmptyMasterTables()
Empties all yatish tables in masterDB.
bool UpdateProject()
Takes care of UPDATEs in yatish_project.
int Upload()
Uploads masterDB into slaveDB.
static wxDatabase * slaveDB
Definition: yatishDBmysql.h:28
bool DownloadNames()
Downloads yatish tables with a single name column.
bool UpdateActivity()
Takes care of UPDATEs in yatish_activity.
int Commit()
Updates slaveDB with records of masterDB where the sync field is not &#39;S&#39;.
bool Insert()
Takes care of INSERTs in yatish tables with a single name column.
bool NewTables()
Creates the yatish tables.
bool InsertTimeslot()
Takes care of INSERTs in yatish_timeslot.
Provides a few basic methods and (static) members to interact with yatish tables. ...
Definition: yatishDB.h:49
bool DownloadTimeslot()
Download yatish_timeslot.