rcpp_framework/database/sqlite/sqlite3_query_builder.h

73 lines
2.1 KiB
C
Raw Normal View History

2021-08-19 22:18:11 +02:00
#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 *udpate();
2021-08-20 12:49:57 +02:00
QueryBuilder *del();
2021-08-20 12:49:57 +02:00
QueryBuilder *where();
2021-08-19 22:18:11 +02:00
QueryBuilder *from();
QueryBuilder *insert();
QueryBuilder *values();
QueryBuilder *cvalues();
QueryBuilder *select(const std::string &params);
QueryBuilder *udpate(const std::string &params);
2021-08-20 12:49:57 +02:00
QueryBuilder *del(const std::string &params);
2021-08-19 22:18:11 +02:00
QueryBuilder *where(const std::string &params);
QueryBuilder *from(const std::string &params);
QueryBuilder *insert(const std::string &table_name);
QueryBuilder *insert(const std::string &table_name, const std::string &columns);
2021-08-19 22:18:11 +02:00
QueryBuilder *values(const std::string &params_str);
QueryBuilder *val();
QueryBuilder *val(const std::string &param);
QueryBuilder *val(const char *param);
QueryBuilder *val(const int param);
QueryBuilder *val(const bool param);
2021-08-19 22:18:11 +02:00
QueryBuilder *set();
QueryBuilder *cset();
QueryBuilder *setp(const std::string &col, const std::string &param);
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);
2021-08-20 12:49:57 +02:00
QueryBuilder *wp(const std::string &col, const std::string &param);
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);
2021-08-19 22:18:11 +02:00
QueryBuilder *limit(const int num);
QueryBuilder *offset(const int num);
QueryBuilder *select_last_insert_id();
2021-08-19 22:18:11 +02: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();
void run_query();
SQLite3QueryBuilder();
~SQLite3QueryBuilder();
SQLite3Database *_db;
};
#endif