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

Copyright2013-2017 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.

Minimal complete definition

liftQualify

Methods

liftQualify :: q a -> m a Source #

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

Instances

(Functor q, Monad q) => MonadQualify q q Source # 

Methods

liftQualify :: q a -> q a Source #

MonadQualify ConfigureQuery QueryUnique Source # 
MonadQualify q m => MonadQualify q (AggregatingSetT m) Source #

Aggregated MonadQualify.

Methods

liftQualify :: q a -> AggregatingSetT m a Source #

MonadQualify q m => MonadQualify q (QueryJoin m) Source # 

Methods

liftQualify :: q a -> QueryJoin m a Source #

MonadQualify q m => MonadQualify q (Assignings r m) Source #

MonadQualify with assigning.

Methods

liftQualify :: q a -> Assignings r m a Source #

MonadQualify q m => MonadQualify q (Orderings c m) Source #

MonadQualify with ordering.

Methods

liftQualify :: q a -> Orderings c m a Source #

MonadQualify q m => MonadQualify q (Restrictings c m) Source #

Restricted MonadQualify instance.

Methods

liftQualify :: q a -> Restrictings c m a Source #

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

Restrict context interface

Minimal complete definition

restrict

Methods

restrict :: Projection c (Maybe Bool) -> m () Source #

Add restriction to this context.

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

Query building interface.

Minimal complete definition

setDuplication, restrictJoin, query', queryMaybe'

Methods

setDuplication :: Duplication -> m () Source #

Specify duplication.

restrictJoin :: Projection Flat (Maybe Bool) -> m () Source #

Add restriction to last join.

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

Join sub-query with place-holder parameter p. query result is not Maybe.

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

Join sub-query with place-holder parameter p. Query result is Maybe.

Instances

MonadQuery QueryUnique Source # 
MonadQuery m => MonadQuery (AggregatingSetT m) Source #

Aggregated MonadQuery.

MonadQuery (QueryJoin ConfigureQuery) Source #

Joinable query instance.

MonadQuery m => MonadQuery (Orderings c m) Source #

MonadQuery with ordering.

MonadQuery q => MonadQuery (Restrictings c q) Source #

Restricted MonadQuery instance.

class Monad m => MonadPartition c m where Source #

Window specification building interface.

Minimal complete definition

partitionBy

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.

Methods

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

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

Specify ALL attribute to query context.

distinct :: MonadQuery m => m () Source #

Specify DISTINCT attribute to query context.

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

Add restriction to last join. Projection type version.

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

Add restriction to this not aggregated query.

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

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