Fledge
An open source edge computing platform for industrial users
Query Class Reference

Storage layer query container. More...

#include <query.h>

Public Member Functions

 Query (Where *where)
 Construct a query with a simple where clause. More...
 
 Query (Aggregate *aggreate, Where *where)
 Construct a query with a where clause and aggregate response. More...
 
 Query (Timebucket *timebucket, Where *where)
 Construct a timebucket query with a simple where clause. More...
 
 Query (Timebucket *timebucket, Where *where, unsigned int limit)
 Construct a timebucket query with a simple where clause and a limit on the rows to return. More...
 
 Query (Returns *returns)
 Construct a simple query to return a certain column from a table. More...
 
 Query (std::vector< Returns *> returns)
 Construct a simple query to return certain columns from a table. More...
 
 Query (std::vector< Returns *> returns, Where *where)
 Construct a query with a fixed set of returned values and a simple where clause. More...
 
 Query (std::vector< Returns *> returns, Where *where, unsigned int limit)
 Construct a query with a fixed set of returned values and a simple where clause and return a limited set of rows. More...
 
 ~Query ()
 Destructor for a query object.
 
void aggregate (Aggregate *aggegate)
 Add a aggregate operation to an existing query object. More...
 
void group (const std::string &column)
 Add a group operation to a query. More...
 
void sort (Sort *sort)
 Add a sort operation to an existing query. More...
 
void limit (unsigned int limit)
 Limit the numebr of rows returned by the query. More...
 
void timebucket (Timebucket *)
 Add a timebucket operation to an existing query. More...
 
void returns (Returns *)
 Limit the query to return just a single column. More...
 
void returns (std::vector< Returns *>)
 Limit the columns returned by the query. More...
 
void distinct ()
 Add a distinct value modifier to the query.
 
void join (Join *join)
 Add a join clause to a query. More...
 
const std::string toJSON () const
 Return the JSON payload for a where clause.
 

Detailed Description

Storage layer query container.

Constructor & Destructor Documentation

◆ Query() [1/8]

Query::Query ( Where where)

Construct a query with a simple where clause.

Parameters
whereA pointer to the where condition

◆ Query() [2/8]

Query::Query ( Aggregate aggregate,
Where where 
)

Construct a query with a where clause and aggregate response.

Parameters
aggregateA ppointer to the aggregate operation to perform
whereA pointer to the where condition

◆ Query() [3/8]

Query::Query ( Timebucket timebucket,
Where where 
)

Construct a timebucket query with a simple where clause.

Parameters
timebuckA pointer to the timebucket definition
whereA pointer to the where condition

◆ Query() [4/8]

Query::Query ( Timebucket timebucket,
Where where,
unsigned int  limit 
)

Construct a timebucket query with a simple where clause and a limit on the rows to return.

Parameters
timebuckA pointer to the timebucket definition
whereA pointer to the where condition
limitThe number of rows to return

◆ Query() [5/8]

Query::Query ( Returns returns)

Construct a simple query to return a certain column from a table.

Parameters
returnsThe rows to return

◆ Query() [6/8]

Query::Query ( std::vector< Returns *>  returns)

Construct a simple query to return certain columns from a table.

Parameters
returnsThe rows to return

◆ Query() [7/8]

Query::Query ( std::vector< Returns *>  returns,
Where where 
)

Construct a query with a fixed set of returned values and a simple where clause.

returns The set of rows to return where The where clause

◆ Query() [8/8]

Query::Query ( std::vector< Returns *>  returns,
Where where,
unsigned int  limit 
)

Construct a query with a fixed set of returned values and a simple where clause and return a limited set of rows.

returns The set of rows to return where The where clause

Parameters
limitThe numebr of rows to return

Member Function Documentation

◆ aggregate()

void Query::aggregate ( Aggregate aggregate)

Add a aggregate operation to an existing query object.

Parameters
aggregateThe aggregate operation to add

◆ group()

void Query::group ( const std::string &  column)

Add a group operation to a query.

Parameters
columnThe column to group by

◆ join()

void Query::join ( Join join)

Add a join clause to a query.

Parameters
joinA pointer to a Join onject

◆ limit()

void Query::limit ( unsigned int  limit)

Limit the numebr of rows returned by the query.

Parameters
limitThe number of rows to limit the return to

◆ returns() [1/2]

void Query::returns ( Returns returns)

Limit the query to return just a single column.

Parameters
returnsThe column to return

◆ returns() [2/2]

void Query::returns ( std::vector< Returns *>  returns)

Limit the columns returned by the query.

Parameters
returnsThe columns to return

◆ sort()

void Query::sort ( Sort sort)

Add a sort operation to an existing query.

Parameters
sortThe sort operation to add

◆ timebucket()

void Query::timebucket ( Timebucket timebucket)

Add a timebucket operation to an existing query.

Parameters
timebucketThe timebucket operation to add to the query

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