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 18 of file yatishDBmysql.h.
yatishDBmysql::yatishDBmysql | ( | ) |
Mainly connects to the MySQL database specified in yatish.auth
(initializing private member slaveDB
).
Definition at line 26 of file yatishDBmysql.cpp.
yatishDBmysql::~yatishDBmysql | ( | ) |
Definition at line 115 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 126 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 wrong Definition at line 219 of file yatishDBmysql.cpp.
int yatishDBmysql::Download | ( | ) |
Downloads slaveDB
into masterDB
.
masterDB
(if any) are erased. Definition at line 150 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 456 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 wrong tableName
was defined with "simple" tables first. Definition at line 282 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 371 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 551 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 180 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 161 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 wrong tableName
was defined with "simple" tables first. Definition at line 250 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 427 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 343 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 514 of file yatishDBmysql.cpp.
|
inline |
Definition at line 22 of file yatishDBmysql.h.
|
private |
Creates the yatish tables.
false
if something went wrong Definition at line 49 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 199 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 wrong tableName
was defined with "simple" tables first. Definition at line 314 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 485 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 399 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 580 of file yatishDBmysql.cpp.
int yatishDBmysql::Upload | ( | ) |
Uploads masterDB
into slaveDB
.
slaveDB
(if any) are erased. Definition at line 138 of file yatishDBmysql.cpp.
|
private |
Definition at line 28 of file yatishDBmysql.h.
|
staticprivate |
Definition at line 27 of file yatishDBmysql.h.