mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
86 lines
2.3 KiB
C++
86 lines
2.3 KiB
C++
#ifndef SQLITE3_QUERY_BUILDER_H
|
|
#define SQLITE3_QUERY_BUILDER_H
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "core/database/query_builder.h"
|
|
|
|
class SQLite3Database;
|
|
|
|
class SQLite3QueryBuilder : public QueryBuilder {
|
|
public:
|
|
QueryBuilder *select();
|
|
QueryBuilder *update();
|
|
QueryBuilder *del();
|
|
|
|
QueryBuilder *where();
|
|
QueryBuilder *from();
|
|
QueryBuilder *insert();
|
|
QueryBuilder *values();
|
|
QueryBuilder *cvalues();
|
|
|
|
QueryBuilder *str();
|
|
QueryBuilder *cstr();
|
|
|
|
QueryBuilder *like();
|
|
|
|
QueryBuilder *nselect(const std::string ¶ms);
|
|
QueryBuilder *nupdate(const std::string ¶ms);
|
|
QueryBuilder *ndel(const std::string ¶ms);
|
|
|
|
QueryBuilder *nwhere(const std::string ¶ms);
|
|
QueryBuilder *nfrom(const std::string ¶ms);
|
|
QueryBuilder *insert(const std::string &table_name);
|
|
QueryBuilder *insert(const std::string &table_name, const std::string &columns);
|
|
QueryBuilder *nvalues(const std::string ¶ms_str);
|
|
QueryBuilder *val();
|
|
QueryBuilder *nval(const std::string ¶m);
|
|
QueryBuilder *val(const char *param);
|
|
QueryBuilder *val(const int param);
|
|
QueryBuilder *val(const bool param);
|
|
|
|
QueryBuilder *nlike(const std::string &str);
|
|
|
|
QueryBuilder *set();
|
|
QueryBuilder *cset();
|
|
QueryBuilder *nsetp(const std::string &col, const std::string ¶m);
|
|
QueryBuilder *setp(const std::string &col, const char *param);
|
|
QueryBuilder *setp(const std::string &col, const int param);
|
|
QueryBuilder *setp(const std::string &col, const bool param);
|
|
|
|
QueryBuilder *nwp(const std::string &col, const std::string ¶m);
|
|
QueryBuilder *wp(const std::string &col, const char *param);
|
|
QueryBuilder *wp(const std::string &col, const int param);
|
|
QueryBuilder *wp(const std::string &col, const bool param);
|
|
|
|
QueryBuilder *limit(const int num);
|
|
QueryBuilder *offset(const int num);
|
|
|
|
//l=logical (and, or are operators)
|
|
QueryBuilder *land();
|
|
QueryBuilder *lor();
|
|
|
|
QueryBuilder *wildcard();
|
|
|
|
QueryBuilder *select_last_insert_id();
|
|
|
|
std::string escape(const std::string ¶ms);
|
|
|
|
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();
|
|
|
|
Ref<QueryResult> run();
|
|
void run_query();
|
|
|
|
SQLite3QueryBuilder();
|
|
~SQLite3QueryBuilder();
|
|
|
|
SQLite3Database *_db;
|
|
};
|
|
|
|
#endif |