relational-query-0.2.0.0: Typeful, Modular, Relational, algebraic query engine

Portabilityunknown
Stabilityexperimental
Maintainerex8k.hibino@gmail.com
Safe HaskellNone

Database.Relational.Query.Component

Contents

Description

This module provides untyped components for query.

Synopsis

Type for column SQL string

type ColumnSQL = ColumnSQL' StringSQLSource

Column SQL string type

columnSQL' :: StringSQL -> ColumnSQLSource

ColumnSQL from StringSQL

showsColumnSQL :: ColumnSQL -> StringSQLSource

StringSQL from ColumnSQL

Configuration type for query

data Config Source

Configuration type.

Instances

defaultConfig :: ConfigSource

Default configuration.

data ProductUnitSupport Source

Unit of product is supported or not.

data Duplication Source

Result record duplication attribute

Constructors

All 
Distinct 

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 AggregateBitKey Source

Type for group key.

data AggregateSet Source

Type for grouping set

Instances

data AggregateElem Source

Type for group-by tree

Instances

Show AggregateElem 
MonadQualify ConfigureQuery QueryAggregate

Instance to lift from qualified table forms into QueryAggregate.

MonadRestrict c m => MonadRestrict c (AggregatingSetT m)

Aggregated MonadRestrict.

MonadQuery m => MonadAggregate (AggregatingSetT m)

Aggregated query instance.

MonadQuery m => MonadQuery (AggregatingSetT m)

Aggregated MonadQuery.

aggregateColumnRef :: AggregateColumnRef -> AggregateElemSource

Single term aggregation element.

aggregateEmpty :: [AggregateElem]Source

Empty aggregation.

aggregatePowerKey :: [AggregateColumnRef] -> AggregateBitKeySource

Key of aggregation power 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

data Order Source

Order direction. Ascendant or Descendant.

Constructors

Asc 
Desc 

Instances

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.