Copyright | 2013 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
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 NameConfig = NameConfig {
- recordConfig :: NameConfig
- relationVarName :: String -> String -> VarName
- data SchemaNameMode
- data Config
- defaultConfig :: Config
- data ProductUnitSupport
- data Duplication
- data IdentifierQuotation
- showsDuplication :: Duplication -> 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 AggregateKey a
- aggregateKeyProjection :: AggregateKey a -> a
- aggregateKeyElement :: AggregateKey a -> AggregateElem
- unsafeAggregateKey :: (a, AggregateElem) -> AggregateKey a
- 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
- composeValues :: Assignments -> StringSQL
- composeOver :: [AggregateColumnRef] -> OrderingTerms -> StringSQL
Type for column SQL string
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.
Constructors
NameConfig | |
Fields
|
Instances
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 |
Instances
defaultConfig :: Config Source #
Default configuration.
data ProductUnitSupport Source #
Unit of product is supported or not.
Constructors
PUSupported | |
PUNotSupported |
Instances
data IdentifierQuotation Source #
Configuration for quotation of identifiers of SQL.
Constructors
NoQuotation | |
Quotation Char |
Instances
Duplication attribute
showsDuplication :: Duplication -> StringSQL Source #
Compose duplication attribute string.
Types for aggregation
type AggregateColumnRef = ColumnSQL Source #
Type for group-by term
data AggregateElem Source #
Type for group-by tree
Instances
Show AggregateElem Source # | |
MonadQualify q m => MonadQualify q (AggregatingSetT m) Source # | Aggregated |
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) Source # | Aggregated |
MonadQuery m => MonadAggregate (AggregatingSetT m) Source # | Aggregated query instance. |
MonadQuery m => MonadQuery (AggregatingSetT m) Source # | Aggregated |
aggregateColumnRef :: AggregateColumnRef -> AggregateElem Source #
Single term aggregation element.
aggregateEmpty :: [AggregateElem] Source #
Empty aggregation.
aggregatePowerKey :: [AggregateColumnRef] -> AggregateBitKey Source #
Key of aggregation power set.
aggregateGroupingSet :: [AggregateElem] -> AggregateSet Source #
Single grouping 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
.
aggregateKeyElement :: AggregateKey a -> AggregateElem Source #
Extract untyped term from AggregateKey
.
unsafeAggregateKey :: (a, AggregateElem) -> AggregateKey a Source #
Unsafely bind typed-projection and untyped-term into AggregateKey
.
Types for ordering
Order direction. Ascendant or Descendant.
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.