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

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Query.Component

Contents

Description

This module provides untyped components for query.

Synopsis

Type for column SQL string

type ColumnSQL = ColumnSQL' StringSQL Source

Column SQL string type

columnSQL' :: StringSQL -> ColumnSQL Source

ColumnSQL from StringSQL

showsColumnSQL :: ColumnSQL -> StringSQL Source

StringSQL from ColumnSQL

Configuration type for query

data NameConfig Source

NameConfig type to customize names of expanded templates.

data SchemaNameMode Source

Schema name qualify mode in SQL string.

Constructors

SchemaQualified

Schema qualified table name in SQL string

SchemaNotQualified

Not qualified table name in SQL string

data Config Source

Configuration type.

Instances

defaultConfig :: Config Source

Default configuration.

data ProductUnitSupport Source

Unit of product is supported or not.

data Duplication Source

Result record duplication attribute

Constructors

All 
Distinct 

Duplication attribute

showsDuplication :: Duplication -> StringSQL Source

Compose duplication attribute string.

Types for aggregation

type AggregateColumnRef = ColumnSQL Source

Type for group-by term

data AggregateBitKey Source

Type for group key.

data AggregateSet Source

Type for grouping set

aggregateColumnRef :: AggregateColumnRef -> AggregateElem Source

Single term aggregation element.

aggregateEmpty :: [AggregateElem] Source

Empty aggregation.

aggregatePowerKey :: [AggregateColumnRef] -> AggregateBitKey Source

Key of aggregation power set.

aggregateRollup :: [AggregateBitKey] -> AggregateElem Source

Rollup aggregation element.

aggregateCube :: [AggregateBitKey] -> AggregateElem Source

Cube aggregation element.

aggregateSets :: [AggregateSet] -> AggregateElem Source

Grouping sets aggregation.

composeGroupBy :: [AggregateElem] -> StringSQL Source

Compose GROUP BY clause from AggregateElem list.

composePartitionBy :: [AggregateColumnRef] -> StringSQL Source

Compose PARTITION BY clause from AggregateColumnRef list.

data AggregateKey a Source

Typeful aggregate element.

aggregateKeyProjection :: AggregateKey a -> a Source

Extract typed projection from AggregateKey.

unsafeAggregateKey :: (a, AggregateElem) -> AggregateKey a Source

Unsafely bind typed-projection and untyped-term into AggregateKey.

Types for ordering

data Order Source

Order direction. Ascendant or Descendant.

Constructors

Asc 
Desc 

Instances

type OrderColumn = ColumnSQL Source

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

Compose ORDER BY clause from OrderingTerms

Types for assignments

type AssignColumn = ColumnSQL Source

Column SQL String

type AssignTerm = ColumnSQL Source

Value SQL String

type Assignment = (AssignColumn, AssignTerm) Source

Assignment pair

type Assignments = [Assignment] Source

Assignment pair list.

composeSets :: Assignments -> StringSQL Source

Compose SET clause from Assignments.

composeValues :: Assignments -> StringSQL Source

Compose VALUES clause from Assignments.

Compose window clause

composeOver :: [AggregateColumnRef] -> OrderingTerms -> StringSQL Source

Compose OVER (PARTITION BY ... ) clause.