AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
anch::sql::SelectBuilderPart Class Reference

SQL select query part builder. More...

#include <selectBuilderPart.hpp>

+ Inheritance diagram for anch::sql::SelectBuilderPart:
+ Collaboration diagram for anch::sql::SelectBuilderPart:

Public Member Functions

anch::sql::FieldsBuilder groupBy (const std::string &column)
 
anch::sql::FieldsBuilder orderBy (const std::string &column)
 
anch::sql::SelectBuilderhaving (anch::sql::ClausesBuilder &clauses)
 
anch::sql::SelectBuilderunionOnce (anch::sql::SelectBuilder &other)
 
anch::sql::SelectBuilderunionAll (anch::sql::SelectBuilder &other)
 
anch::sql::SelectBuilderoffset (int64_t offset)
 
anch::sql::SelectBuilderfetch (uint64_t limit)
 
anch::sql::SelectBuilderwindowByRowNumber (const std::string &alias, const std::string &rowColumn, const std::string &order, uint32_t min, uint32_t max)
 
anch::sql::SelectBuilderwindowByRank (const std::string &alias, const std::string &rowColumn, const std::string &order, uint32_t min, uint32_t max)
 
anch::sql::SelectBuilderdone ()
 
anch::sql::SQLQuery build ()
 

Protected Member Functions

 SelectBuilderPart ()=delete
 
 SelectBuilderPart (anch::sql::SelectBuilder &select)
 
virtual ~SelectBuilderPart ()
 

Protected Attributes

anch::sql::SelectBuilder_select
 

Detailed Description

SQL select query part builder.

Acts like a decorator to call some initial SelectBuilder methods.

Since
0.1
Author
Vincent Lachenal

Constructor & Destructor Documentation

◆ SelectBuilderPart() [1/2]

anch::sql::SelectBuilderPart::SelectBuilderPart ( )
protecteddelete

Prohibits SelectBuilderPart default constructor

◆ SelectBuilderPart() [2/2]

anch::sql::SelectBuilderPart::SelectBuilderPart ( anch::sql::SelectBuilder & select)
protected

SelectBuilderPart constructor

Parameters
selectthe select query builder
+ Here is the call graph for this function:

◆ ~SelectBuilderPart()

virtual anch::sql::SelectBuilderPart::~SelectBuilderPart ( )
protectedvirtual

SelectBuilderPart destructor

Member Function Documentation

◆ build()

anch::sql::SQLQuery anch::sql::SelectBuilderPart::build ( )

Build SQL query

Returns
the query and its prepared statement values

◆ done()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::done ( )

Return the original SelectBuilder

Returns
the SelectBuilder

◆ fetch()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::fetch ( uint64_t limit)

Add FETCH FIRST n ROWS ONLY

Parameters
limitthe limit value
Returns
the SelectBuilder

◆ groupBy()

anch::sql::FieldsBuilder anch::sql::SelectBuilderPart::groupBy ( const std::string & column)

Add SQL GROUP BY command

Parameters
columnthe first column to group by
Returns
a new FieldsBuilder to add other columns

◆ having()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::having ( anch::sql::ClausesBuilder & clauses)

Add SQL HAVING command and its clauses if not empty

Parameters
clausesthe clauses
Returns
the SelectBuilder
+ Here is the call graph for this function:

◆ offset()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::offset ( int64_t offset)

Add OFFSET n ROWS

Parameters
offsetthe offset value
Returns
the SelectBuilder
+ Here is the call graph for this function:

◆ orderBy()

anch::sql::FieldsBuilder anch::sql::SelectBuilderPart::orderBy ( const std::string & column)

Add SQL ORDER BY command

Parameters
columnthe first column to group by
Returns
a new FieldsBuilder to add other columns

◆ unionAll()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::unionAll ( anch::sql::SelectBuilder & other)

Add UNION to other SQL request

Parameters
otherthe other SQL request
Returns
the SelectBuilder

◆ unionOnce()

anch::sql::SelectBuilder & anch::sql::SelectBuilderPart::unionOnce ( anch::sql::SelectBuilder & other)

Add UNION to other SQL request

Parameters
otherthe other SQL request
Returns
the SelectBuilder

◆ windowByRank()

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.

Parameters
aliasthe current query table alias
rowColumnthe row column alias
orderthe ORDER instruction
minthe minimum row number value
maxthe maximum row number value
Returns
the SelectBuilder

◆ windowByRowNumber()

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.

Parameters
aliasthe current query table alias
rowColumnthe row column alias
orderthe ORDER instruction
minthe minimum row number value
maxthe maximum row number value
Returns
the SelectBuilder

Member Data Documentation

◆ _select

anch::sql::SelectBuilder& anch::sql::SelectBuilderPart::_select
protected

SQL select query builder


The documentation for this class was generated from the following file: