MySQLClient.h 725 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef MYSQLCLIENT_H
  2. #define MYSQLCLIENT_H
  3. #include "MySQLResultSet.h"
  4. #include <memory>
  5. #include <string>
  6. namespace MySQL {
  7. class MySQLClientImpl;
  8. class MySQLClient
  9. {
  10. public:
  11. MySQLClient();
  12. ~MySQLClient();
  13. void Connect(const std::string& hostname, const std::string& username, const std::string& password);
  14. void Connect(const std::string& hostname, const std::string& username, const std::string& password, const std::string& database);
  15. void Disconnect();
  16. std::string Database() const;
  17. void Execute(const std::string& query) const;
  18. MySQLResultSet ExecuteQuery(const std::string& query) const;
  19. private:
  20. std::unique_ptr<MySQLClientImpl> m_pMySQLClientImpl;
  21. };
  22. } // namespace MySQL
  23. #endif // MYSQLCLIENT_H