Dynamic SQL select request builder.
More...
#include <selectBuilder.hpp>
|
|
SelectBuilder | anch::sql::select () |
| std::ostream & | operator<< (std::ostream &stream, const SelectBuilder &builder) |
Dynamic SQL select request builder.
Dynamic SQL select request builder
- Author
- Vincent Lachenal
- Since
- 0.1
◆ ~SelectBuilder()
| virtual anch::sql::SelectBuilder::~SelectBuilder |
( |
| ) |
|
|
virtual |
◆ build()
Build SQL query
- Returns
- the query and its prepared statement values
◆ distinct()
| SelectBuilder & anch::sql::SelectBuilder::distinct |
( |
| ) |
|
Add DISTINCT command
- Returns
this
◆ fetch()
| SelectBuilder & anch::sql::SelectBuilder::fetch |
( |
uint64_t | limit | ) |
|
Add FETCH FIRST n ROWS ONLY
- Parameters
-
- Returns
this
◆ field()
Intialize a new fields builder
- Returns
- the fields builder
◆ groupBy()
Add SQL GROUP BY command
- Parameters
-
| column | the first column to group by |
- Returns
- a new FieldsBuilder to add other columns
◆ having()
Add SQL HAVING command and its clauses if not empty
- Parameters
-
- Returns
this
◆ offset()
| SelectBuilder & anch::sql::SelectBuilder::offset |
( |
int64_t | offset | ) |
|
Add OFFSET n ROWS
- Parameters
-
- Returns
this
◆ orderBy()
Add SQL ORDER BY command
- Parameters
-
| column | the first column to group by |
- Returns
- a new FieldsBuilder to add other columns
◆ unionAll()
| SelectBuilder & anch::sql::SelectBuilder::unionAll |
( |
SelectBuilder & | other | ) |
|
Add UNION to other SQL request
- Parameters
-
| other | the other SQL request |
- Returns
this
◆ unionOnce()
| SelectBuilder & anch::sql::SelectBuilder::unionOnce |
( |
SelectBuilder & | other | ) |
|
Add UNION to other SQL request
- Parameters
-
| other | the other SQL request |
- Returns
this
◆ windowByRank()
| SelectBuilder & anch::sql::SelectBuilder::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.
- Parameters
-
| 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 |
- Returns
this
◆ windowByRowNumber()
| SelectBuilder & anch::sql::SelectBuilder::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.
- Parameters
-
| 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 |
- Returns
this
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
const SelectBuilder & | builder ) |
|
friend |
SelectBuilder stream insertion operator
- Parameters
-
- Returns
- the output stream
The documentation for this class was generated from the following file: