Portability | unknown |
---|---|
Stability | experimental |
Maintainer | [email protected] |
Safe Haskell | None |
Database.Relational.Query.Component
Contents
Description
This module provides untyped components for query.
- type ColumnSQL = ColumnSQL' StringSQL
- columnSQL :: String -> ColumnSQL
- columnSQL' :: StringSQL -> ColumnSQL
- showsColumnSQL :: ColumnSQL -> StringSQL
- data Config
- defaultConfig :: Config
- data ProductUnitSupport
- data Duplication
- showsDuplication :: Duplication -> StringSQL
- type QueryRestriction c = [Expr c Bool]
- composeWhere :: QueryRestriction Flat -> StringSQL
- composeHaving :: QueryRestriction Aggregated -> StringSQL
- type AggregateColumnRef = ColumnSQL
- data AggregateBitKey
- data AggregateSet
- data AggregateElem
- aggregateColumnRef :: AggregateColumnRef -> AggregateElem
- aggregateEmpty :: [AggregateElem]
- aggregatePowerKey :: [AggregateColumnRef] -> AggregateBitKey
- aggregateGroupingSet :: [AggregateElem] -> AggregateSet
- aggregateRollup :: [AggregateBitKey] -> AggregateElem
- aggregateCube :: [AggregateBitKey] -> AggregateElem
- aggregateSets :: [AggregateSet] -> AggregateElem
- composeGroupBy :: [AggregateElem] -> StringSQL
- composePartitionBy :: [AggregateColumnRef] -> StringSQL
- data Order
- type OrderColumn = ColumnSQL
- type OrderingTerm = (Order, OrderColumn)
- type OrderingTerms = [OrderingTerm]
- composeOrderBy :: OrderingTerms -> StringSQL
- type AssignColumn = ColumnSQL
- type AssignTerm = ColumnSQL
- type Assignment = (AssignColumn, AssignTerm)
- type Assignments = [Assignment]
- composeSets :: Assignments -> StringSQL
- composeOver :: [AggregateColumnRef] -> OrderingTerms -> StringSQL
Type for column SQL string
columnSQL' :: StringSQL -> ColumnSQLSource
ColumnSQL
from StringSQL
showsColumnSQL :: ColumnSQL -> StringSQLSource
StringSQL from ColumnSQL
Configuration type for query
Default configuration.
data ProductUnitSupport Source
Unit of product is supported or not.
Constructors
PUSupported | |
PUNotSupported |
Instances
Duplication attribute
showsDuplication :: Duplication -> StringSQLSource
Compose duplication attribute string.
Query restriction
type QueryRestriction c = [Expr c Bool]Source
Type for restriction of query.
composeWhere :: QueryRestriction Flat -> StringSQLSource
Compose WHERE clause from QueryRestriction
.
composeHaving :: QueryRestriction Aggregated -> StringSQLSource
Compose HAVING clause from QueryRestriction
.
Types for aggregation
type AggregateColumnRef = ColumnSQLSource
Type for group-by term
data AggregateElem Source
Type for group-by tree
Instances
Show AggregateElem | |
MonadQualify ConfigureQuery QueryAggregate | Instance to lift from qualified table forms into |
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) | Aggregated |
MonadQuery m => MonadAggregate (AggregatingSetT m) | Aggregated query instance. |
MonadQuery m => MonadQuery (AggregatingSetT m) | Aggregated |
aggregateColumnRef :: AggregateColumnRef -> AggregateElemSource
Single term aggregation element.
aggregateEmpty :: [AggregateElem]Source
Empty aggregation.
aggregatePowerKey :: [AggregateColumnRef] -> AggregateBitKeySource
Key of aggregation power set.
aggregateGroupingSet :: [AggregateElem] -> AggregateSetSource
Single grouping set.
aggregateRollup :: [AggregateBitKey] -> AggregateElemSource
Rollup aggregation element.
aggregateCube :: [AggregateBitKey] -> AggregateElemSource
Cube aggregation element.
aggregateSets :: [AggregateSet] -> AggregateElemSource
Grouping sets aggregation.
composeGroupBy :: [AggregateElem] -> StringSQLSource
Compose GROUP BY clause from AggregateElem list.
composePartitionBy :: [AggregateColumnRef] -> StringSQLSource
Compose PARTITION BY clause from AggregateColumnRef list.
Types for ordering
type OrderColumn = ColumnSQLSource
Type for order-by column
type OrderingTerm = (Order, OrderColumn)Source
Type for order-by term
type OrderingTerms = [OrderingTerm]Source
Type for order-by terms
composeOrderBy :: OrderingTerms -> StringSQLSource
Compose ORDER BY clause from OrderingTerms
Types for assignments
type AssignColumn = ColumnSQLSource
Column SQL String
type AssignTerm = ColumnSQLSource
Value SQL String
type Assignment = (AssignColumn, AssignTerm)Source
Assignment pair
type Assignments = [Assignment]Source
Assignment pair list.
composeSets :: Assignments -> StringSQLSource
Compose SET clause from Assignments
.
Compose window clause
composeOver :: [AggregateColumnRef] -> OrderingTerms -> StringSQLSource
Compose OVER (PARTITION BY ... ) clause.