mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
#ifndef QUERY_BUILDER_H
|
|
#define QUERY_BUILDER_H
|
|
|
|
#include <string>
|
|
|
|
class QueryResult;
|
|
|
|
//methods that start with an e escape their params.
|
|
|
|
class QueryBuilder {
|
|
public:
|
|
virtual QueryBuilder *select();
|
|
virtual QueryBuilder *where();
|
|
virtual QueryBuilder *from();
|
|
virtual QueryBuilder *insert();
|
|
virtual QueryBuilder *values();
|
|
virtual QueryBuilder *cvalues();
|
|
|
|
virtual QueryBuilder *select(const std::string ¶ms);
|
|
virtual QueryBuilder *where(const std::string ¶ms);
|
|
virtual QueryBuilder *from(const std::string ¶ms);
|
|
virtual QueryBuilder *insert(const std::string &table_name);
|
|
virtual QueryBuilder *values(const std::string ¶ms_str);
|
|
|
|
virtual QueryBuilder *eselect(const std::string ¶ms);
|
|
virtual QueryBuilder *ewhere(const std::string ¶ms);
|
|
virtual QueryBuilder *efrom(const std::string ¶ms);
|
|
virtual QueryBuilder *einsert(const std::string &table_name);
|
|
virtual QueryBuilder *evalues(const std::string ¶ms_str);
|
|
|
|
virtual QueryBuilder *limit(const int min, const int max);
|
|
|
|
virtual std::string escape(const std::string ¶ms);
|
|
|
|
virtual QueryBuilder *prepare();
|
|
virtual QueryBuilder *set_param(const int index, const std::string &value);
|
|
virtual QueryBuilder *set_param(const int index, const int value);
|
|
virtual QueryBuilder *set_param(const int index, const float value);
|
|
|
|
virtual void end_command();
|
|
|
|
virtual QueryResult *run();
|
|
|
|
std::string get_result();
|
|
|
|
QueryBuilder();
|
|
virtual ~QueryBuilder();
|
|
|
|
std::string query_result;
|
|
};
|
|
|
|
#endif |