Copyright | 2013-2017 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 -> [OrderingTerm] -> SubQuery
- aggregatedSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> [AggregateElem] -> QueryRestriction Aggregated -> [OrderingTerm] -> 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
- queryWidth :: Qualified SubQuery -> Int
- column :: Qualified SubQuery -> Int -> StringSQL
- data Projection c t
- data ProjectionUnit
- type UntypedProjection = [ProjectionUnit]
- untypedProjectionFromJoinedSubQuery :: Qualified SubQuery -> UntypedProjection
- projectionColumns :: Projection c r -> [StringSQL]
- unsafeProjectionStringSql :: Projection c r -> StringSQL
- type JoinProduct = Maybe QueryProductTree
- data NodeAttr
- type ProductBuilder = Node QueryRestrictionBuilder
- type QueryRestriction c = [Projection c (Maybe Bool)]
- composeWhere :: QueryRestriction Flat -> StringSQL
- composeHaving :: QueryRestriction Aggregated -> StringSQL
Sub-query
flatSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> [OrderingTerm] -> SubQuery Source #
Unsafely generate flat SubQuery
from untyped components.
aggregatedSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> [AggregateElem] -> QueryRestriction Aggregated -> [OrderingTerm] -> SubQuery Source #
Unsafely generate aggregated SubQuery
from untyped components.
except :: Duplication -> SubQuery -> SubQuery -> SubQuery Source #
Except binary operator on SubQuery
intersect :: Duplication -> SubQuery -> SubQuery -> SubQuery Source #
Intersect binary operator on SubQuery
Qualified Sub-query
Qualified query.
Sub-query columns
Projection
data Projection c t Source #
Phantom typed projection. Projected into Haskell record type t
.
ProjectableMaybe (Projection c) Source # | Control phantom |
ProjectableShowSql (Projection c) Source # | Unsafely get SQL term from |
SqlProjectable (Projection OverWindow) Source # | Unsafely make |
SqlProjectable (Projection Aggregated) Source # | Unsafely make |
SqlProjectable (Projection Flat) Source # | Unsafely make |
Show (Projection c t) Source # | |
data ProjectionUnit Source #
Projection structure unit with single column width
type UntypedProjection = [ProjectionUnit] Source #
Untyped projection. Forgot record type.
untypedProjectionFromJoinedSubQuery :: Qualified SubQuery -> UntypedProjection Source #
Make untyped projection from joined sub-query.
:: Projection c r | Source |
-> [StringSQL] | Result SQL string list |
Get column SQL string list of projection.
unsafeProjectionStringSql :: Projection c r -> StringSQL Source #
Unsafely get SQL term from Proejction
.
Product of sub-queries
type JoinProduct = Maybe QueryProductTree Source #
Type for join product of query.
type ProductBuilder = Node QueryRestrictionBuilder Source #
Product noe with join restriction builder.
Query restriction
type QueryRestriction c = [Projection c (Maybe Bool)] Source #
Type for restriction of query.
composeWhere :: QueryRestriction Flat -> StringSQL Source #
Compose WHERE clause from QueryRestriction
.
composeHaving :: QueryRestriction Aggregated -> StringSQL Source #
Compose HAVING clause from QueryRestriction
.