mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Added order_by to the QueryBuilder.
This commit is contained in:
parent
e79ddd1b4a
commit
86b890eb8f
@ -193,6 +193,58 @@ QueryBuilder *QueryBuilder::offset(const int num) {
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::order_by_asc(const String &col) {
|
||||
query_result += "ORDER BY " + col + " ASC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::order_by_desc(const String &col) {
|
||||
query_result += "ORDER BY " + col + " DESC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::order_by(const String &col) {
|
||||
query_result += "ORDER BY " + col + ", ";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::order_by() {
|
||||
query_result += "ORDER BY ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::corder_by() {
|
||||
query_result[query_result.size() - 2] = ' ';
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::asc() {
|
||||
query_result += "ASC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::desc() {
|
||||
query_result += "DESC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::order_by_add_col(const String &col) {
|
||||
query_result += col + ", ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::asc(const String &col) {
|
||||
query_result += col + " ASC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
QueryBuilder *QueryBuilder::desc(const String &col) {
|
||||
query_result += col + " DESC, ";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder *QueryBuilder::land() {
|
||||
return this;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
virtual QueryBuilder *values();
|
||||
virtual QueryBuilder *cvalues();
|
||||
virtual QueryBuilder *next_value();
|
||||
|
||||
|
||||
virtual QueryBuilder *begin_transaction();
|
||||
virtual QueryBuilder *commit();
|
||||
|
||||
@ -83,6 +83,18 @@ public:
|
||||
virtual QueryBuilder *limit(const int num);
|
||||
virtual QueryBuilder *offset(const int num);
|
||||
|
||||
virtual QueryBuilder *order_by_asc(const String &col);
|
||||
virtual QueryBuilder *order_by_desc(const String &col);
|
||||
virtual QueryBuilder *order_by(const String &col);
|
||||
|
||||
virtual QueryBuilder *order_by();
|
||||
virtual QueryBuilder *corder_by();
|
||||
virtual QueryBuilder *asc();
|
||||
virtual QueryBuilder *desc();
|
||||
virtual QueryBuilder *order_by_add_col(const String &col);
|
||||
virtual QueryBuilder *asc(const String &col);
|
||||
virtual QueryBuilder *desc(const String &col);
|
||||
|
||||
//l=logical (and, or are operators)
|
||||
virtual QueryBuilder *land();
|
||||
virtual QueryBuilder *lor();
|
||||
|
Loading…
Reference in New Issue
Block a user