mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-05 05:17:47 +08:00
41 lines
863 B
C++
41 lines
863 B
C++
/*
|
|
* MySQLConnect.h
|
|
*
|
|
* Copyright (c) 2019, hikyuu.org
|
|
*
|
|
* Created on: 2019-8-17
|
|
* Author: fasiondog
|
|
*/
|
|
|
|
#pragma once
|
|
#ifndef HIYUU_DB_CONNECT_MYSQL_MYSQLCONNECT_H
|
|
#define HIYUU_DB_CONNECT_MYSQL_MYSQLCONNECT_H
|
|
|
|
#include "../DBConnectBase.h"
|
|
#include "MySQLStatement.h"
|
|
|
|
#if defined(_MSC_VER)
|
|
#include <mysql.h>
|
|
#else
|
|
#include <mysql/mysql.h>
|
|
#endif
|
|
|
|
namespace hku {
|
|
|
|
class HKU_API MySQLConnect : public DBConnectBase {
|
|
public:
|
|
MySQLConnect(const Parameter& param);
|
|
virtual ~MySQLConnect();
|
|
|
|
virtual void exec(const string& sql_string) override;
|
|
virtual SQLStatementPtr getStatement(const string& sql_statement) override;
|
|
virtual bool tableExist(const string& tablename) override;
|
|
|
|
private:
|
|
friend class MySQLStatement;
|
|
shared_ptr<MYSQL> m_mysql;
|
|
};
|
|
|
|
} // namespace hku
|
|
|
|
#endif /* HIYUU_DB_CONNECT_MYSQL_MYSQLCONNECT_H */ |