rcpp_framework/database_backends/sqlite/sqlite3_query_builder.h

96 lines
2.5 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 "database/query_builder.h"
2021-08-19 22:18:11 +02:00
class SQLite3Database;
class SQLite3QueryBuilder : public QueryBuilder {
RCPP_OBJECT(SQLite3QueryBuilder, QueryBuilder);
2021-08-19 22:18:11 +02:00
public:
QueryBuilder *select();
2021-11-01 17:00:55 +01:00
QueryBuilder *update();
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();
2021-11-14 19:22:49 +01:00
QueryBuilder *next_value();
QueryBuilder *begin_transaction();
QueryBuilder *commit();
2021-08-19 22:18:11 +02:00
2021-08-22 21:44:20 +02:00
QueryBuilder *str();
QueryBuilder *cstr();
QueryBuilder *like();
2021-11-01 17:31:04 +01:00
QueryBuilder *nselect(const String &params);
QueryBuilder *nupdate(const String &params);
QueryBuilder *ndel(const String &params);
QueryBuilder *nwhere(const String &params);
QueryBuilder *nfrom(const String &params);
QueryBuilder *insert(const String &table_name);
QueryBuilder *insert(const String &table_name, const String &columns);
QueryBuilder *nvalues(const String &params_str);
QueryBuilder *val();
2021-11-01 17:31:04 +01:00
QueryBuilder *nval(const String &param);
QueryBuilder *val(const char *param);
QueryBuilder *val(const int param);
QueryBuilder *val(const bool param);
QueryBuilder *valf(const float param);
QueryBuilder *vald(const double param);
2021-08-19 22:18:11 +02:00
2021-11-01 17:31:04 +01:00
QueryBuilder *nlike(const String &str);
2021-08-22 21:44:20 +02:00
QueryBuilder *set();
QueryBuilder *cset();
2021-11-01 17:31:04 +01:00
QueryBuilder *nsetp(const String &col, const String &param);
QueryBuilder *setp(const String &col, const char *param);
QueryBuilder *setp(const String &col, const int param);
QueryBuilder *setp(const String &col, const bool param);
QueryBuilder *setpf(const String &col, const float param);
QueryBuilder *setpd(const String &col, const double param);
2021-11-01 17:31:04 +01:00
QueryBuilder *nwp(const String &col, const String &param);
QueryBuilder *wp(const String &col, const char *param);
QueryBuilder *wp(const String &col, const int param);
QueryBuilder *wp(const String &col, const bool param);
2021-08-20 12:49:57 +02:00
2021-08-19 22:18:11 +02:00
QueryBuilder *limit(const int num);
QueryBuilder *offset(const int num);
//l=logical (and, or are operators)
2021-08-22 21:44:20 +02:00
QueryBuilder *land();
QueryBuilder *lor();
QueryBuilder *wildcard();
QueryBuilder *select_last_insert_id();
2021-11-01 17:31:04 +01:00
String escape(const String &params);
2021-08-19 22:18:11 +02:00
QueryBuilder *prepare();
2021-11-01 17:31:04 +01:00
QueryBuilder *set_param(const int index, const String &value);
2021-08-19 22:18:11 +02:00
QueryBuilder *set_param(const int index, const int value);
QueryBuilder *set_param(const int index, const float value);
2021-11-14 19:22:49 +01:00
QueryBuilder *end_command();
2021-08-19 22:18:11 +02:00
Ref<QueryResult> run();
2021-08-19 22:18:11 +02:00
void run_query();
SQLite3QueryBuilder();
~SQLite3QueryBuilder();
SQLite3Database *_db;
};
#endif