Copyright | 2013 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module defines sub-query structure used in query products.
- data SubQuery
- fromTable :: Table r -> SubQuery
- flatSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> OrderingTerms -> SubQuery
- aggregatedSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> [AggregateElem] -> QueryRestriction Aggregated -> OrderingTerms -> SubQuery
- union :: Duplication -> SubQuery -> SubQuery -> SubQuery
- except :: Duplication -> SubQuery -> SubQuery -> SubQuery
- intersect :: Duplication -> SubQuery -> SubQuery -> SubQuery
- showSQL :: SubQuery -> StringSQL
- toSQL :: SubQuery -> String
- unitSQL :: SubQuery -> String
- width :: SubQuery -> Int
- newtype Qualifier = Qualifier Int
- data Qualified a
- qualifier :: Qualified a -> Qualifier
- unQualify :: Qualified a -> a
- qualify :: a -> Qualifier -> Qualified a
- queryWidth :: Qualified SubQuery -> Int
- column :: Qualified SubQuery -> Int -> ColumnSQL
- data ProjectionUnit
- type UntypedProjection = [ProjectionUnit]
- untypedProjectionFromColumns :: [ColumnSQL] -> UntypedProjection
- untypedProjectionFromJoinedSubQuery :: Qualified SubQuery -> UntypedProjection
- untypedProjectionFromScalarSubQuery :: SubQuery -> UntypedProjection
- widthOfUntypedProjection :: UntypedProjection -> Int
- columnsOfUntypedProjection :: UntypedProjection -> [ColumnSQL]
- type QueryProduct = ProductTree (Qualified SubQuery)
- type QueryProductNode = Node (Qualified SubQuery)
- type JoinProduct = Maybe QueryProduct
Sub-query
flatSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> OrderingTerms -> SubQuery Source
Unsafely generate flat SubQuery
from untyped components.
aggregatedSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> [AggregateElem] -> QueryRestriction Aggregated -> OrderingTerms -> SubQuery Source
Unsafely generate aggregated SubQuery
from untyped components.
intersect :: Duplication -> SubQuery -> SubQuery -> SubQuery Source
Intersect binary operator on SubQuery
Qualified Sub-query
Qualified query.
Sub-query columns
Untyped projection
type UntypedProjection = [ProjectionUnit] Source
Untyped projection. Forgot record type.
untypedProjectionFromColumns :: [ColumnSQL] -> UntypedProjection Source
Make untyped projection from columns.
untypedProjectionFromJoinedSubQuery :: Qualified SubQuery -> UntypedProjection Source
Make untyped projection from joined sub-query.
untypedProjectionFromScalarSubQuery :: SubQuery -> UntypedProjection Source
Make untyped projection from scalar sub-query.
widthOfUntypedProjection :: UntypedProjection -> Int Source
Width of UntypedProjection
.
columnsOfUntypedProjection Source
:: UntypedProjection | Source |
-> [ColumnSQL] | Result SQL string list |
Get column SQL string list of projection.
Product of sub-queries
type QueryProduct = ProductTree (Qualified SubQuery) Source
Product tree specialized by SubQuery
.
type QueryProductNode = Node (Qualified SubQuery) Source
Product node specialized by SubQuery
.
type JoinProduct = Maybe QueryProduct Source
Type for join product of query.