35 lines
633 B
C++
35 lines
633 B
C++
#ifndef MYSQL_CONNECTION
|
|
#define MYSQL_CONNECTION
|
|
|
|
#include "core/database.h"
|
|
|
|
#include <memory>
|
|
|
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
|
//later this will be fixed better
|
|
#ifdef IS_NUM
|
|
#undef IS_NUM
|
|
#endif
|
|
|
|
#include <mysql.h>
|
|
|
|
class MysqlDatabase : public Database {
|
|
public:
|
|
void connect(const std::string &connection_str);
|
|
void query(const std::string &query);
|
|
|
|
//virtual std::shared_ptr<QueryBuilder> get_builder();
|
|
|
|
static Database *_creation_func();
|
|
static void _register();
|
|
static void _unregister();
|
|
|
|
MysqlDatabase();
|
|
~MysqlDatabase();
|
|
|
|
MYSQL *mysql;
|
|
};
|
|
|
|
#undef IS_NUM
|
|
|
|
#endif |