diff options
Diffstat (limited to 'mg_database.h')
-rw-r--r-- | mg_database.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/mg_database.h b/mg_database.h index 3f2c323..54baef1 100644 --- a/mg_database.h +++ b/mg_database.h @@ -35,22 +35,47 @@ class mgDB * \param pass * \param port */ - mgDB( std::string host, std::string name, - std::string user, std::string pass, - int port ); + mgDB( std::string host, std::string name, + std::string user="", std::string pass="", + int port = 0 ); + + // add constructor for sockets /*! \brief constructor */ ~mgDB(); - /*! \brief obtain database handle*/ + /*! + * \brief obtain database handle + */ MYSQL getDBHandle(); + /*! + * \brief database initialization + */ + // int initialize(); + + /*! + * \brief helper function to execute read queries + * + * \todo Could be a member of mgDatabase? + */ + MYSQL_RES* read_query( const char *fmt, ... ); + + /*! + * \brief helper function to execute write queries + * + * \todo Could be a member of mgDatabase? + */ + void write_query( const char *fmt, ... ); + /*! * \brief escape arguments to be contained in a query * * \todo use m_dbase member of this class */ static std::string escape_string( MYSQL *db, std::string s ); + + private: MYSQL m_dbase; |