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

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

Database.Relational.Query.Monad.Class

Contents

Description

This module defines query building interface classes.

Synopsis

Query interface classes

class (Functor q, Monad q, Functor m, Monad m) => MonadQualify q m where Source

Lift interface from base qualify monad.

Methods

liftQualify :: q a -> m a Source

Lift from qualify monad q into MonadQuery m. Qualify monad qualifies table form SubQuery.

class (Functor m, Monad m) => MonadRestrict c m where Source

Restrict context interface

Methods

restrict Source

Arguments

:: Projection c (Maybe Bool)

Projection which represent restriction

-> m ()

Restricted query context

Add restriction to this context.

class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where Source

Query building interface.

Methods

setDuplication :: Duplication -> m () Source

Specify duplication.

restrictJoin Source

Arguments

:: Projection Flat (Maybe Bool)

Projection which represent restriction

-> m ()

Restricted query context

Add restriction to last join.

query' :: Relation p r -> m (PlaceHolders p, Projection Flat r) Source

queryMaybe' :: Relation p r -> m (PlaceHolders p, Projection Flat (Maybe r)) Source

class MonadQuery m => MonadAggregate m where Source

Aggregated query building interface extends MonadQuery.

Methods

groupBy Source

Arguments

:: Projection Flat r

Projection to add into group by

-> m (Projection Aggregated r)

Result context and aggregated projection | Add GROUP BY term into context and get aggregated projection. Non-traditional group-by version.

Add GROUP BY term into context and get aggregated projection.

groupBy' Source

Arguments

:: AggregateKey (Projection Aggregated r)

Key to aggretate for non-traditional group-by interface

-> m (Projection Aggregated r)

Result context and aggregated projection

Instances

class Monad m => MonadPartition c m where Source

Window specification building interface.

Methods

partitionBy :: Projection c r -> m () Source

Add PARTITION BY term into context.

Instances

Monad m => MonadPartition c (PartitioningSetT c m) Source

Partition clause instance

MonadPartition c m => MonadPartition c (Orderings c m) Source

MonadPartition with ordering.

all' :: MonadQuery m => m () Source

Specify ALL attribute to query context.

distinct :: MonadQuery m => m () Source

Specify DISTINCT attribute to query context.

onE :: MonadQuery m => Expr Flat (Maybe Bool) -> m () Source

Add restriction to last join.

on :: MonadQuery m => Projection Flat (Maybe Bool) -> m () Source

Add restriction to last join. Projection type version.

wheresE :: MonadRestrict Flat m => Expr Flat (Maybe Bool) -> m () Source

Add restriction to this query. Expr type version.

wheres :: MonadRestrict Flat m => Projection Flat (Maybe Bool) -> m () Source

Add restriction to this not aggregated query.

havingE :: MonadRestrict Aggregated m => Expr Aggregated (Maybe Bool) -> m () Source

Add restriction to this aggregated query. Expr type version.

having :: MonadRestrict Aggregated m => Projection Aggregated (Maybe Bool) -> m () Source

Add restriction to this aggregated query. Aggregated Projection type version.