Copyright  2013 Kei Hibino 

License  BSD3 
Maintainer  ex8k.hibino@gmail.com 
Stability  experimental 
Portability  unknown 
Safe Haskell  None 
Language  Haskell2010 
This module defines query building interface classes.
 class (Functor q, Monad q, Functor m, Monad m) => MonadQualify q m where
 liftQualify :: q a > m a
 class (Functor m, Monad m) => MonadRestrict c m where
 restrict :: Projection c (Maybe Bool) > m ()
 class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where
 setDuplication :: Duplication > m ()
 restrictJoin :: Projection Flat (Maybe Bool) > m ()
 query' :: Relation p r > m (PlaceHolders p, Projection Flat r)
 queryMaybe' :: Relation p r > m (PlaceHolders p, Projection Flat (Maybe r))
 class MonadQuery m => MonadAggregate m where
 groupBy :: Projection Flat r > m (Projection Aggregated r)
 groupBy' :: AggregateKey (Projection Aggregated r) > m (Projection Aggregated r)
 class Monad m => MonadPartition c m where
 partitionBy :: Projection c r > m ()
 all' :: MonadQuery m => m ()
 distinct :: MonadQuery m => m ()
 onE :: MonadQuery m => Expr Flat (Maybe Bool) > m ()
 on :: MonadQuery m => Projection Flat (Maybe Bool) > m ()
 wheresE :: MonadRestrict Flat m => Expr Flat (Maybe Bool) > m ()
 wheres :: MonadRestrict Flat m => Projection Flat (Maybe Bool) > m ()
 havingE :: MonadRestrict Aggregated m => Expr Aggregated (Maybe Bool) > m ()
 having :: MonadRestrict Aggregated m => Projection Aggregated (Maybe Bool) > m ()
Query interface classes
class (Functor q, Monad q, Functor m, Monad m) => MonadQualify q m where Source
Lift interface from base qualify monad.
liftQualify :: q a > m a Source
Lift from qualify monad q
into MonadQuery
m.
Qualify monad qualifies table form SubQuery
.
(Functor q, Monad q) => MonadQualify q q Source  
MonadQualify ConfigureQuery QueryUnique Source  
MonadQualify q m => MonadQualify q (AggregatingSetT m) Source  Aggregated 
MonadQualify q m => MonadQualify q (QueryJoin m) Source  
MonadQualify q m => MonadQualify q (Orderings c m) Source 

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

MonadQualify q m => MonadQualify q (Restrictings c m) Source  Restricted 
class (Functor m, Monad m) => MonadRestrict c m where Source
Restrict context interface
:: Projection c (Maybe Bool) 

> m ()  Restricted query context 
Add restriction to this context.
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) Source  Aggregated 
MonadRestrict rc m => MonadRestrict rc (Orderings c m) Source 

MonadRestrict c m => MonadRestrict c (Assignings r m) Source 

(Monad q, Functor q) => MonadRestrict c (Restrictings c q) Source 

class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where Source
Query building interface.
setDuplication :: Duplication > m () Source
Specify duplication.
:: Projection Flat (Maybe Bool) 

> 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
MonadQuery QueryUnique Source  
MonadQuery m => MonadQuery (AggregatingSetT m) Source  Aggregated 
MonadQuery (QueryJoin ConfigureQuery) Source  Joinable query instance. 
MonadQuery m => MonadQuery (Orderings c m) Source 

MonadQuery q => MonadQuery (Restrictings c q) Source  Restricted 
class MonadQuery m => MonadAggregate m where Source
Aggregated query building interface extends MonadQuery
.
:: 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. Nontraditional groupby version. 
Add GROUP BY term into context and get aggregated projection.
:: AggregateKey (Projection Aggregated r)  Key to aggretate for nontraditional groupby interface 
> m (Projection Aggregated r)  Result context and aggregated projection 
MonadQuery m => MonadAggregate (AggregatingSetT m) Source  Aggregated query instance. 
MonadAggregate m => MonadAggregate (Orderings c m) Source 

MonadAggregate m => MonadAggregate (Restrictings c m) Source  Resticted 
class Monad m => MonadPartition c m where Source
Window specification building interface.
partitionBy :: Projection c r > m () Source
Add PARTITION BY term into context.
Monad m => MonadPartition c (PartitioningSetT c m) Source  Partition clause instance 
MonadPartition c m => MonadPartition c (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.
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.