SQL select query part builder. More...
#include <selectBuilderPart.hpp>
Public Member Functions | |
anch::sql::FieldsBuilder | groupBy (const std::string &column) |
anch::sql::FieldsBuilder | orderBy (const std::string &column) |
anch::sql::SelectBuilder & | having (anch::sql::ClausesBuilder &clauses) |
anch::sql::SelectBuilder & | unionOnce (anch::sql::SelectBuilder &other) |
anch::sql::SelectBuilder & | unionAll (anch::sql::SelectBuilder &other) |
anch::sql::SelectBuilder & | offset (int64_t offset) |
anch::sql::SelectBuilder & | fetch (uint64_t limit) |
anch::sql::SelectBuilder & | windowByRowNumber (const std::string &alias, const std::string &rowColumn, const std::string &order, uint32_t min, uint32_t max) |
anch::sql::SelectBuilder & | windowByRank (const std::string &alias, const std::string &rowColumn, const std::string &order, uint32_t min, uint32_t max) |
anch::sql::SelectBuilder & | done () |
anch::sql::SQLQuery | build () |
Protected Member Functions | |
SelectBuilderPart ()=delete | |
SelectBuilderPart (anch::sql::SelectBuilder &select) | |
virtual | ~SelectBuilderPart () |
Protected Attributes | |
anch::sql::SelectBuilder & | _select |
SQL select query part builder.
Acts like a decorator to call some initial SelectBuilder methods.
|
protecteddelete |
Prohibits SelectBuilderPart default constructor
|
protected |
SelectBuilderPart constructor
select | the select query builder |
|
protectedvirtual |
SelectBuilderPart destructor
anch::sql::SQLQuery anch::sql::SelectBuilderPart::build | ( | ) |
Build SQL query
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::done | ( | ) |
Return the original SelectBuilder
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::fetch | ( | uint64_t | limit | ) |
anch::sql::FieldsBuilder anch::sql::SelectBuilderPart::groupBy | ( | const std::string & | column | ) |
Add SQL GROUP BY
command
column | the first column to group by |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::having | ( | anch::sql::ClausesBuilder & | clauses | ) |
Add SQL HAVING
command and its clauses if not empty
clauses | the clauses |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::offset | ( | int64_t | offset | ) |
Add OFFSET n ROWS
offset | the offset value |
anch::sql::FieldsBuilder anch::sql::SelectBuilderPart::orderBy | ( | const std::string & | column | ) |
Add SQL ORDER BY
command
column | the first column to group by |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::unionAll | ( | anch::sql::SelectBuilder & | other | ) |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::unionOnce | ( | anch::sql::SelectBuilder & | other | ) |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::windowByRank | ( | const std::string & | alias, |
const std::string & | rowColumn, | ||
const std::string & | order, | ||
uint32_t | min, | ||
uint32_t | max ) |
Modify current query to add apply rank
window function as define in SQL:2003 standard.
alias | the current query table alias |
rowColumn | the row column alias |
order | the ORDER instruction |
min | the minimum row number value |
max | the maximum row number value |
anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::windowByRowNumber | ( | const std::string & | alias, |
const std::string & | rowColumn, | ||
const std::string & | order, | ||
uint32_t | min, | ||
uint32_t | max ) |
Modify current query to add apply row_number
window function as define in SQL:2003 standard.
alias | the current query table alias |
rowColumn | the row column alias |
order | the ORDER instruction |
min | the minimum row number value |
max | the maximum row number value |
|
protected |
SQL select query builder