This module contains datatype declarations, constructor functions selectors and translation functions for complex select queries in particular for those selecting (1 to 5) single columns.
Author: Julia Krone
Constructors:
Union
:: SetOp
Intersect
:: SetOp
Except
:: SetOp
datatype for joins
Constructors:
Cross
:: Join
Inner
:: Constraint -> Join
data structure to represent a table-clause (tables and joins) in a way that at least one table has to be specified
Constructors:
TC
:: Table -> Int -> (Maybe (Join,TableClause)) -> TableClause
Datatype representing a single column in a select-clause. Can be just a column connected with an alias and an optional aggregation function(String) or a Case-when-then-statement
Constructors:
ResultColumnDescription
:: (ColumnDescription a) -> Int -> String -> ColumnSingleCollection a
Case
:: Condition -> (CValue,CValue) -> (CaseVal a) -> ColumnSingleCollection a
Datatype to select two different columns which can be of different types and from different tables.
Type synonym: ColumnTupleCollection a b = (ColumnSingleCollection a,ColumnSingleCollection b)
Datatype to select three different columns which can be of different types and from different tables.
Type synonym: ColumnTripleCollection a b c = (ColumnSingleCollection a,ColumnSingleCollection b,ColumnSingleCollection c)
Datatype to select four different columns which can be of different types and from different tables.
Type synonym: ColumnFourTupleCollection a b c d = (ColumnSingleCollection a,ColumnSingleCollection b,ColumnSingleCollection c,ColumnSingleCollection d)
Datatype to select five different columns which can be of different types and from different tables.
Type synonym: ColumnFiveTupleCollection a b c d e = (ColumnSingleCollection a,ColumnSingleCollection b,ColumnSingleCollection c,ColumnSingleCollection d,ColumnSingleCollection e)
Datatype to select five different columns which can be of different types and from different tables.
Type synonym: ColumnSixTupleCollection a b c d e f = (ColumnSingleCollection a,ColumnSingleCollection b,ColumnSingleCollection c,ColumnSingleCollection d,ColumnSingleCollection e,ColumnSingleCollection f)
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for a single column.
Constructors:
SingleCS
:: Specifier -> (ColumnSingleCollection a) -> TableClause -> Criteria -> SingleColumnSelect a
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for two columns.
Constructors:
TupleCS
:: Specifier -> (ColumnTupleCollection a b) -> TableClause -> Criteria -> TupleColumnSelect a b
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for three columns.
Constructors:
TripleCS
:: Specifier -> (ColumnTripleCollection a b c) -> TableClause -> Criteria -> TripleColumnSelect a b c
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for four columns.
Constructors:
FourCS
:: Specifier -> (ColumnFourTupleCollection a b c d) -> TableClause -> Criteria -> FourColumnSelect a b c d
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for five columns.
Constructors:
FiveCS
:: Specifier -> (ColumnFiveTupleCollection a b c d e) -> TableClause -> Criteria -> FiveColumnSelect a b c d e
Datatype to describe all parts of a select-query without Setoperators order-by and limit (selecthead) for five columns.
Constructors:
SixCS
:: Specifier -> (ColumnSixTupleCollection a b c d e f) -> TableClause -> Criteria -> SixColumnSelect a b c d e f
Constructorfunction for an inner join
|
Constructorfunction for cross join
|
Constructor for aggregation function sum in select-clauses. A pseudo-ResultColumnDescription of type float is created for correct return type.
|
Constructor for aggregation function avg in select-clauses. A pseudo-ResultColumnDescription of type float is created for correct return type.
|
Constructor for aggregation function count in select-clauses. A pseudo-ResultColumnDescription of type float is created for correct return type.
|
Constructor for aggregation function min in select-clauses.
|
Constructor for aggregation function max in select-clauses.
|
Constructor function in case no aggregation function is specified.
|
|
|
|
|
|
Constructor function for representation of statement: CASE WHEN condition THEN val1 ELSE val2 END. It does only work for the same type in then and else branch.
|
Constructorfunction for ColumnSingleCollection. |
|
|
|
|
Constructor function for ColumnSixTupleCollection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|