mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Added more helpers to QueryBuilder.
This commit is contained in:
parent
1ec66db3c7
commit
1bd90ceb4a
@ -28,6 +28,22 @@ QueryBuilder *QueryBuilder::values() {
|
||||
QueryBuilder *QueryBuilder::cvalues() {
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::next_value() {
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::begin_transaction() {
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::commit() {
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::nl() {
|
||||
query_result += "\n";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::str() {
|
||||
return this;
|
||||
@ -176,7 +192,7 @@ QueryBuilder *QueryBuilder::wildcard() {
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::w(const String &str) {
|
||||
query_result += str + " ";
|
||||
query_result += str;
|
||||
|
||||
return this;
|
||||
}
|
||||
@ -205,7 +221,8 @@ QueryBuilder *QueryBuilder::set_param(const int index, const float value) {
|
||||
return this;
|
||||
}
|
||||
|
||||
void QueryBuilder::end_command() {
|
||||
QueryBuilder *QueryBuilder::end_command() {
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::reset() {
|
||||
|
@ -20,6 +20,12 @@ public:
|
||||
virtual QueryBuilder *insert();
|
||||
virtual QueryBuilder *values();
|
||||
virtual QueryBuilder *cvalues();
|
||||
virtual QueryBuilder *next_value();
|
||||
|
||||
virtual QueryBuilder *begin_transaction();
|
||||
virtual QueryBuilder *commit();
|
||||
|
||||
virtual QueryBuilder *nl();
|
||||
|
||||
virtual QueryBuilder *str();
|
||||
virtual QueryBuilder *cstr();
|
||||
@ -91,7 +97,7 @@ public:
|
||||
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 QueryBuilder *end_command();
|
||||
|
||||
virtual QueryBuilder *reset();
|
||||
|
||||
|
@ -88,8 +88,10 @@ QueryBuilder *MysqlQueryBuilder::set_param(const int index, const float value) {
|
||||
return this;
|
||||
}
|
||||
|
||||
void MysqlQueryBuilder::end_command() {
|
||||
QueryBuilder *MysqlQueryBuilder::end_command() {
|
||||
query_result += ";";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Ref<QueryResult> MysqlQueryBuilder::run() {
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
QueryBuilder *set_param(const int index, const int value);
|
||||
QueryBuilder *set_param(const int index, const float value);
|
||||
|
||||
void end_command();
|
||||
QueryBuilder *end_command();
|
||||
|
||||
Ref<QueryResult> run();
|
||||
void run_query();
|
||||
|
@ -47,6 +47,23 @@ QueryBuilder *SQLite3QueryBuilder::cvalues() {
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *SQLite3QueryBuilder::next_value() {
|
||||
query_result[query_result.size() - 2] = ' ';
|
||||
query_result += "), (";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *SQLite3QueryBuilder::begin_transaction() {
|
||||
query_result += "BEGIN TRANSACTION;";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *SQLite3QueryBuilder::commit() {
|
||||
query_result += "COMMIT;";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *SQLite3QueryBuilder::str() {
|
||||
query_result += "'";
|
||||
@ -278,8 +295,10 @@ QueryBuilder *SQLite3QueryBuilder::set_param(const int index, const float value)
|
||||
return this;
|
||||
}
|
||||
|
||||
void SQLite3QueryBuilder::end_command() {
|
||||
QueryBuilder *SQLite3QueryBuilder::end_command() {
|
||||
query_result += ";";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Ref<QueryResult> SQLite3QueryBuilder::run() {
|
||||
|
@ -19,6 +19,10 @@ public:
|
||||
QueryBuilder *insert();
|
||||
QueryBuilder *values();
|
||||
QueryBuilder *cvalues();
|
||||
QueryBuilder *next_value();
|
||||
|
||||
QueryBuilder *begin_transaction();
|
||||
QueryBuilder *commit();
|
||||
|
||||
QueryBuilder *str();
|
||||
QueryBuilder *cstr();
|
||||
@ -72,7 +76,7 @@ public:
|
||||
QueryBuilder *set_param(const int index, const int value);
|
||||
QueryBuilder *set_param(const int index, const float value);
|
||||
|
||||
void end_command();
|
||||
QueryBuilder *end_command();
|
||||
|
||||
Ref<QueryResult> run();
|
||||
void run_query();
|
||||
|
Loading…
Reference in New Issue
Block a user