|
YATISH
Yet Another TIme SHeet
|
Interacts with yatish tables in a MySQL/MariaDB database. More...
#include <yatishDBmysql.h>


Public Member Functions | |
| yatishDBmysql () | |
Mainly connects to the MySQL database specified in yatish.auth More... | |
| ~yatishDBmysql () | |
| bool | IsOk () |
| int | Commit () |
Updates slaveDB with records of masterDB where the sync field is not 'S'. More... | |
| int | Upload () |
Uploads masterDB into slaveDB. More... | |
| int | Download () |
Downloads slaveDB into masterDB. More... | |
Private Member Functions | |
| bool | NewTables () |
| Creates the yatish tables. More... | |
| bool | EmptySlaveTables () |
Empties all yatish tables in slaveDB. More... | |
| bool | EmptyMasterTables () |
Empties all yatish tables in masterDB. More... | |
| bool | OutdateMasterTables () |
Sets the sync field to 'I' in all records of all yatish tables in masterDB. More... | |
| bool | Delete () |
| Takes care of DELETEs in yatish tables. More... | |
| bool | Insert () |
| Takes care of INSERTs in yatish tables with a single name column. More... | |
| bool | InsertProject () |
| Takes care of INSERTs in yatish_project. More... | |
| bool | InsertActivity () |
| Takes care of INSERTs in yatish_activity. More... | |
| bool | InsertTimeslot () |
| Takes care of INSERTs in yatish_timeslot. More... | |
| bool | Update () |
| Takes care of UPDATEs in yatish tables with a single name column. More... | |
| bool | UpdateProject () |
| Takes care of UPDATEs in yatish_project. More... | |
| bool | UpdateActivity () |
| Takes care of UPDATEs in yatish_activity. More... | |
| bool | UpdateTimeslot () |
| Takes care of UPDATEs in yatish_timeslot. More... | |
| bool | DownloadNames () |
| Downloads yatish tables with a single name column. More... | |
| bool | DownloadProject () |
| Downloads yatish_project. More... | |
| bool | DownloadActivity () |
| Downloads yatish_activity. More... | |
| bool | DownloadTimeslot () |
| Download yatish_timeslot. More... | |
Private Attributes | |
| int | errorCode |
Static Private Attributes | |
| static wxDatabase * | slaveDB = nullptr |
Additional Inherited Members | |
Static Public Attributes inherited from yatishDB | |
| static const char * | tableName [] |
Must be defined in the same order as enum tableID. More... | |
Protected Member Functions inherited from yatishDB | |
| wxDatabase * | GetDatabase (const wxString &) |
Sets up a (configuration) flux using its argument then calls wxDatabase::GetDatabase(). More... | |
| bool | TablesOk (wxDatabase *) |
Returns false if any of the yatish table is missings. More... | |
Static Protected Attributes inherited from yatishDB | |
| static wxDatabase * | masterDB = nullptr |
Interacts with yatish tables in a MySQL/MariaDB database.
Definition at line 19 of file yatishDBmysql.h.
| yatishDBmysql::yatishDBmysql | ( | ) |
Mainly connects to the MySQL database specified in yatish.auth
(initializing private member slaveDB).
Definition at line 27 of file yatishDBmysql.cpp.
| yatishDBmysql::~yatishDBmysql | ( | ) |
Definition at line 116 of file yatishDBmysql.cpp.
| int yatishDBmysql::Commit | ( | ) |
Updates slaveDB with records of masterDB where the sync field is not 'S'.
Also sets the (local) sync field to 'S' when (remote) data were updated with no error.
Definition at line 127 of file yatishDBmysql.cpp.
|
private |
Takes care of DELETEs in yatish tables.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrongN.B. We rely on the fact that the id of a record is the same in both RDBMS (cf. Insert()).
Definition at line 221 of file yatishDBmysql.cpp.
| int yatishDBmysql::Download | ( | ) |
Downloads slaveDB into masterDB.
Warning! Former data in masterDB (if any) are erased.
Definition at line 151 of file yatishDBmysql.cpp.
|
private |
Downloads yatish_activity.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 457 of file yatishDBmysql.cpp.
|
private |
Downloads yatish tables with a single name column.
The id is also copied (we do not use local AUTO_INCREMENT). The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrongN.B. This function assumes tableName was defined with "simple" tables first.
Definition at line 285 of file yatishDBmysql.cpp.
|
private |
Downloads yatish_project.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 374 of file yatishDBmysql.cpp.
|
private |
Download yatish_timeslot.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 542 of file yatishDBmysql.cpp.
|
private |
Empties all yatish tables in masterDB.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 181 of file yatishDBmysql.cpp.
|
private |
Empties all yatish tables in slaveDB.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 162 of file yatishDBmysql.cpp.
|
private |
Takes care of INSERTs in yatish tables with a single name column.
The id is also copied (we do not use remote AUTO_INCREMENT). The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrongN.B. This function assumes tableName was defined with "simple" tables first.
Definition at line 252 of file yatishDBmysql.cpp.
|
private |
Takes care of INSERTs in yatish_activity.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 428 of file yatishDBmysql.cpp.
|
private |
Takes care of INSERTs in yatish_project.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 346 of file yatishDBmysql.cpp.
|
private |
Takes care of INSERTs in yatish_timeslot.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 513 of file yatishDBmysql.cpp.
|
inline |
Definition at line 23 of file yatishDBmysql.h.
|
private |
Creates the yatish tables.
Warning! If any of the tables was already there, it is emptied.
false if something went wrong Definition at line 50 of file yatishDBmysql.cpp.
|
private |
Sets the sync field to 'I' in all records of all yatish tables in masterDB.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 200 of file yatishDBmysql.cpp.
|
private |
Takes care of UPDATEs in yatish tables with a single name column.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrongN.B. This function assumes tableName was defined with "simple" tables first.
N.B. We rely on the fact that the id of a record is the same in both RDBMS (cf. Insert()).
Definition at line 317 of file yatishDBmysql.cpp.
|
private |
Takes care of UPDATEs in yatish_activity.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 484 of file yatishDBmysql.cpp.
|
private |
Takes care of UPDATEs in yatish_project.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 400 of file yatishDBmysql.cpp.
|
private |
Takes care of UPDATEs in yatish_timeslot.
The error code from the wxDatabase library (if any) is stored in errorCode (private member).
false if something went wrong Definition at line 569 of file yatishDBmysql.cpp.
| int yatishDBmysql::Upload | ( | ) |
Uploads masterDB into slaveDB.
Warning! Former data in slaveDB (if any) are erased.
Definition at line 139 of file yatishDBmysql.cpp.
|
private |
Definition at line 29 of file yatishDBmysql.h.
|
staticprivate |
Definition at line 28 of file yatishDBmysql.h.
1.8.13