YATiSh
Yet Another TIme SHeet
|
Provides a few basic methods and (static) members to interact with yatish tables. More...
#include <yatishDB.h>
Static Public Attributes | |
static const char * | tableName [] |
Must be defined in the same order as enum tableID . More... | |
Protected Member Functions | |
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 | |
static wxDatabase * | masterDB = nullptr |
Provides a few basic methods and (static) members to interact with yatish tables.
yatishDB
and its daugters potentially raise wxDatabaseException
s. The list of yatish error codes is centralized here for reference:
Error code | Raised by | Error message |
---|---|---|
-1 | yatishDB::GetDatabase | Authentication file not found |
-2 | yatishDB::GetDatabase | Authentication file cannot be opened |
-3 | yatishDB::GetDatabase | Error while reading the authentication file |
-4 | yatishDBsqlite::yatishDBsqlite | Master DB must be SQLite |
-4 | yatishDBmysql::yatishDBmysql | Slave DB must be MySQL |
-5 | yatishDBsqlite::yatishDBsqlite | Yatish tables not found |
-5 | yatishDBmysql::yatishDBmysql | Yatish tables not created |
(error codes from the wxDatabase library itself are positive...).
Definition at line 42 of file yatishDB.h.
|
protected |
Sets up a (configuration) flux using its argument then calls wxDatabase::GetDatabase()
.
configString |
|
wxDatabase
, or nullptr
if something went wrongIf configString = ""
, the function uses the last valid credentials found in yatish.auth
; for instance:
is equivalent to calling the function with the non-empty argument "[SQLite]\ndatabase=yatish.sqlite"
because the MySQL account is commented out.
Definition at line 48 of file yatishDB.cpp.
|
protected |
Returns false
if any of the yatish table is missings.
Definition at line 83 of file yatishDB.cpp.
|
staticprotected |
Definition at line 46 of file yatishDB.h.
|
static |
Must be defined in the same order as enum tableID
.
Furthermore this order is consistent with the yatish foreign key constraints for SQL CREATE (DROP on the contrary, should be performed in reverse order).
Definition at line 44 of file yatishDB.h.