ToolMap
Loading...
Searching...
No Matches
DataBase Class Reference
Inheritance diagram for DataBase:
DataBaseTM

Public Member Functions

 DataBase (const wxString &errmsgpath=wxEmptyString)
 
bool DataBaseCreateNew (const wxString &datadir, const wxString &name)
 
bool DataBaseOpen (const wxString &datadir, const wxString &name)
 Open a mysql / mariadb database This function performs the following work:
 
bool DataBaseDelete ()
 
wxString DataBaseGetName ()
 
wxString DataBaseGetPath ()
 
wxString DataBaseGetSize (int precision=2, const wxString &failmsg=_("Not available"))
 
wxString DataBaseGetLastError ()
 
bool DataBaseThreadInit ()
 Init internal variables for new thread.
 
void DataBaseThreadEnd ()
 End internal variables for new thread.
 
bool DataBaseQueryNoResults (const wxString &query, bool logerror=true)
 
bool DataBaseQuery (const wxString &query, bool logerror=true)
 
int DataBaseQueriesNumber (const wxString &query)
 
long DataBaseGetLastInsertedID ()
 
long DataBaseGetAffectedRows ()
 
bool DataBaseHasResults ()
 
void DataBaseClearResults ()
 
bool DataBaseGetResultSize (unsigned int *pcols, long *prows)
 
bool DataBaseGetNextResult (wxString &result)
 
bool DataBaseGetNextResult (wxArrayString &results)
 
bool DataBaseGetNextResult (long &result)
 
bool DataBaseGetNextResult (wxArrayLong &results)
 
bool DataBaseGetNextResult (wxDouble &result)
 
bool DataBaseGetNextResult (wxArrayDouble &results)
 
bool DataBaseGetNextRowResult (MYSQL_ROW &row, tmArrayULong &lengths)
 
bool DataBaseGetResults (wxArrayString &results)
 
bool DataBaseGetResults (wxArrayLong &results)
 
bool DataBaseGetResults (wxArrayDouble &results)
 
bool DataBaseGetResults (DataBaseResult *results)
 

Static Public Member Functions

static wxString DataBaseGetVersion ()
 
static bool DataBaseStringEscapeQuery (const wxString &query, wxString &results)
 

Member Function Documentation

◆ DataBaseOpen()

bool DataBase::DataBaseOpen ( const wxString &  datadir,
const wxString &  name 
)

Open a mysql / mariadb database This function performs the following work:

  1. Initialize the mysql library if necessary (will be done only once).
  2. Check that the path (datadir) is not empty and is not different from the previous one
  3. Close a possible connection and make a new connection.
    Parameters
    [out]boolreturn true if opening is working
    [in]datadirpath of the database (only one path is working for the whole program, mariadb limitation)
    [in]namename of the database

◆ DataBaseThreadEnd()

void DataBase::DataBaseThreadEnd ( )

End internal variables for new thread.

Call this function for each thread you have called DataBase::DataBaseNewThreadInit()

Author
Lucien Schreiber (c) CREALP 2008
Date
24 July 2008

◆ DataBaseThreadInit()

bool DataBase::DataBaseThreadInit ( )

Init internal variables for new thread.

Call this function to init internal values for each new thread.

Returns
TRUE if thread init success, FALSE in case of faillure. An LogDebug message is also issued
Author
Lucien Schreiber (c) CREALP 2008
Date
24 July 2008

The documentation for this class was generated from the following files: