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

Portabilityunknown
Stabilityexperimental
Maintainerex8k.hibino@gmail.com
Safe HaskellNone

Database.Relational.Query.Sub

Contents

Description

This module defines sub-query structure used in query products.

Synopsis

Sub-query

data SubQuery Source

Sub-query type

Instances

fromTableSource

Arguments

:: Table r

Typed Table metadata

-> SubQuery

Result SubQuery

flatSubQuery :: Config -> UntypedProjection -> Duplication -> JoinProduct -> QueryRestriction Flat -> OrderingTerms -> SubQuerySource

Unsafely generate flat SubQuery from untyped components.

union :: Duplication -> SubQuery -> SubQuery -> SubQuerySource

Union binary operator on SubQuery

except :: Duplication -> SubQuery -> SubQuery -> SubQuerySource

Except binary operator on SubQuery

intersect :: Duplication -> SubQuery -> SubQuery -> SubQuerySource

Intersect binary operator on SubQuery

showSQL :: SubQuery -> StringSQLSource

SQL StringSQL for toplevel-SQL.

toSQL :: SubQuery -> StringSource

SQL string for toplevel-SQL.

unitSQL :: SubQuery -> StringSource

SQL string for nested-qeury.

Qualified Sub-query

newtype Qualifier Source

Qualifier type.

Constructors

Qualifier Int 

Instances

data Qualified a Source

Qualified query.

Instances

qualifier :: Qualified a -> QualifierSource

Get qualifier

unQualify :: Qualified a -> aSource

Unqualify.

qualify :: a -> Qualifier -> Qualified aSource

Add qualifier

Sub-query columns

column :: Qualified SubQuery -> Int -> ColumnSQLSource

Get column SQL string of SubQuery.

Untyped projection

data ProjectionUnit Source

Projection structure unit

Instances

type UntypedProjection = [ProjectionUnit]Source

Untyped projection. Forgot record type.

untypedProjectionFromColumns :: [ColumnSQL] -> UntypedProjectionSource

Make untyped projection from columns.

untypedProjectionFromJoinedSubQuery :: Qualified SubQuery -> UntypedProjectionSource

Make untyped projection from joined sub-query.

untypedProjectionFromScalarSubQuery :: SubQuery -> UntypedProjectionSource

Make untyped projection from scalar sub-query.

columnsOfUntypedProjectionSource

Arguments

:: UntypedProjection

Source Projection

-> [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 QueryProductSource

Type for join product of query.