You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractSql.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // Created by robin on 4/6/16.
  3. //
  4. #ifndef PDNS_SLAVE_ABSTRACTSQL_H
  5. #define PDNS_SLAVE_ABSTRACTSQL_H
  6. #include <DBO/Result.h>
  7. #include <DBO/SqlConfiguration.h>
  8. #include <DBO/Actions/ActionAddDomain.h>
  9. #include <DBO/Actions/ActionAddHost.h>
  10. #include <DBO/Actions/ActionDelDomain.h>
  11. #include <DBO/Actions/ActionDelHost.h>
  12. #include "DBO/Result.h"
  13. class AbstractSql
  14. {
  15. public:
  16. AbstractSql(const SqlConfiguration& masterConfig, const SqlConfiguration& slaveConfig);
  17. virtual ~AbstractSql();
  18. virtual BResult dump() = 0;
  19. virtual BResult insert() = 0;
  20. virtual BResult override(const std::string& sql) = 0;
  21. virtual std::string getAddDomainQuery(const ActionAddDomain& action) = 0;
  22. virtual std::string getAddHostQuery(const ActionAddHost& action) = 0;
  23. virtual std::string getDelDomainQuery(const ActionDelDomain& action) = 0;
  24. virtual std::string getDelHostQuery(const ActionDelHost& action) = 0;
  25. protected:
  26. SqlConfiguration _masterConfig;
  27. SqlConfiguration _slaveConfig;
  28. };
  29. #endif //PDNS_SLAVE_ABSTRACTSQL_H