mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-11-22 08:57:34 +01:00
108 lines
3.0 KiB
C++
108 lines
3.0 KiB
C++
#ifndef SQLITE3_QUERY_BUILDER_H
|
|
#define SQLITE3_QUERY_BUILDER_H
|
|
|
|
#include "core/string/ustring.h"
|
|
|
|
#include "../database/query_builder.h"
|
|
|
|
class SQLite3DatabaseConnection;
|
|
|
|
class SQLite3QueryBuilder : public QueryBuilder {
|
|
GDCLASS(SQLite3QueryBuilder, QueryBuilder);
|
|
|
|
public:
|
|
QueryBuilder *select();
|
|
QueryBuilder *update();
|
|
QueryBuilder *del();
|
|
|
|
QueryBuilder *cvalues();
|
|
QueryBuilder *next_value();
|
|
|
|
QueryBuilder *begin_transaction();
|
|
QueryBuilder *commit();
|
|
|
|
QueryBuilder *str();
|
|
QueryBuilder *cstr();
|
|
|
|
QueryBuilder *like(const String &str = "");
|
|
|
|
QueryBuilder *nselect(const String ¶ms);
|
|
QueryBuilder *nupdate(const String ¶ms);
|
|
QueryBuilder *ndel(const String ¶ms);
|
|
|
|
QueryBuilder *nwhere(const String ¶ms);
|
|
QueryBuilder *nfrom(const String ¶ms);
|
|
|
|
QueryBuilder *insert(const String &table_name = "", const String &columns = "");
|
|
QueryBuilder *nvalues(const String ¶ms_str);
|
|
QueryBuilder *val();
|
|
QueryBuilder *nval(const String ¶m);
|
|
|
|
QueryBuilder *vals(const String ¶m);
|
|
QueryBuilder *vals(const char *param);
|
|
QueryBuilder *vali(const int param);
|
|
QueryBuilder *valb(const bool param);
|
|
QueryBuilder *valf(const float param);
|
|
QueryBuilder *vald(const double param);
|
|
virtual QueryBuilder *valph();
|
|
virtual QueryBuilder *valphi(const String &p_id);
|
|
virtual QueryBuilder *valphr(const String &p_raw_id);
|
|
|
|
QueryBuilder *nlike(const String &str);
|
|
|
|
QueryBuilder *sets();
|
|
QueryBuilder *cset();
|
|
|
|
QueryBuilder *nsetp(const String &col, const String ¶m);
|
|
|
|
QueryBuilder *setps(const String &col, const char *param);
|
|
QueryBuilder *setpi(const String &col, const int param);
|
|
QueryBuilder *setpb(const String &col, const bool param);
|
|
QueryBuilder *setpf(const String &col, const float param);
|
|
QueryBuilder *setpd(const String &col, const double param);
|
|
virtual QueryBuilder *setph(const String &col);
|
|
virtual QueryBuilder *setphi(const String &col, const String &p_id);
|
|
virtual QueryBuilder *setphr(const String &col, const String &p_raw_id);
|
|
|
|
QueryBuilder *nwp(const String &col, const String ¶m);
|
|
|
|
QueryBuilder *wps(const String &col, const char *param);
|
|
QueryBuilder *wpi(const String &col, const int param);
|
|
QueryBuilder *wpb(const String &col, const bool param);
|
|
virtual QueryBuilder *wph(const String &col);
|
|
virtual QueryBuilder *wphi(const String &col, const String &p_id);
|
|
virtual QueryBuilder *wphr(const String &col, const String &p_raw_id);
|
|
|
|
QueryBuilder *limit(const int num);
|
|
QueryBuilder *offset(const int num);
|
|
|
|
//l=logical (and, or are operators)
|
|
QueryBuilder *land();
|
|
QueryBuilder *lor();
|
|
|
|
QueryBuilder *wildcard();
|
|
|
|
// Prepared statement placeholders
|
|
virtual QueryBuilder *psph();
|
|
virtual QueryBuilder *psphi(const String &p_id);
|
|
virtual QueryBuilder *psphr(const String &p_raw_id);
|
|
|
|
QueryBuilder *select_last_insert_id();
|
|
|
|
String escape(const String ¶ms);
|
|
|
|
QueryBuilder *end_command();
|
|
|
|
Ref<QueryResult> run();
|
|
void run_query();
|
|
|
|
Ref<PreparedStatement> create_prepared_statement();
|
|
|
|
SQLite3QueryBuilder();
|
|
~SQLite3QueryBuilder();
|
|
|
|
Ref<SQLite3DatabaseConnection> _connection;
|
|
};
|
|
|
|
#endif
|