rcpp_framework/database/mysql/mysql_query_builder.h

48 lines
1.1 KiB
C
Raw Normal View History

#ifndef MYSQL_QUERY_BUILDER_H
#define MYSQL_QUERY_BUILDER_H
#include <memory>
#include <string>
#include "core/database/query_builder.h"
2020-12-01 22:23:28 +01:00
class MysqlDatabase;
class MysqlQueryResult;
class MysqlQueryBuilder : public QueryBuilder {
public:
QueryBuilder *select();
QueryBuilder *where();
QueryBuilder *from();
QueryBuilder *insert();
QueryBuilder *values();
QueryBuilder *cvalues();
QueryBuilder *select(const std::string &params);
QueryBuilder *where(const std::string &params);
QueryBuilder *from(const std::string &params);
QueryBuilder *insert(const std::string &table_name);
QueryBuilder *values(const std::string &params_str);
2021-08-19 22:03:22 +02:00
QueryBuilder *limit(const int num);
QueryBuilder *offset(const int num);
2020-12-01 22:23:28 +01:00
std::string escape(const std::string &params);
QueryBuilder *prepare();
QueryBuilder *set_param(const int index, const std::string &value);
QueryBuilder *set_param(const int index, const int value);
QueryBuilder *set_param(const int index, const float value);
void end_command();
QueryResult *run();
2021-08-19 22:03:22 +02:00
void run_query();
MysqlQueryBuilder();
~MysqlQueryBuilder();
MysqlDatabase *_db;
};
#endif