Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bias/configurators/mysql-configurator
1 result
Show changes
Commits on Source (3)
Subproject commit 8a0ea2d0e699863df5fe1c91caf2d7b0855957be
Subproject commit a00f9a27afbf5f75dab7db2368b9b9b6fcb395e1
......@@ -5,20 +5,41 @@
namespace inaf::oasbo::Configurators {
/**
* @brief A class that represents a MySQL configurator.
*
* This class is responsible for reading and pushing configurations to a MySQL database.
* It inherits from the BaseConfigurator class. Check Base_Configurator.h for more information.
*/
class MysqlConfigurator: public BaseConfigurator {
protected:
sql::mysql::MySQL_Driver *driver = nullptr;
sql::Connection *con = nullptr;
public:
/**
* @brief Constructs a MysqlConfigurator object with the specified parameters.
*
* @param ip The IP address of the MySQL server.
* @param port The port number of the MySQL server.
* @param username The username for connecting to the MySQL server.
* @param password The password for connecting to the MySQL server.
* @param dbname The name of the MySQL database.
*/
MysqlConfigurator(std::string ip, int port, std::string username,
std::string password, std::string dbname);
int readConfigFromSource() override;
int readConfigFromSource(std::string target) override;
int pushConfigToSource() override;
int pushConfigToSource(std::string target) override;
int insert(std::map<std::string, std::string>, std::string target) override;
~MysqlConfigurator() {
if (con != nullptr) {
con->close();
......