Copyright  20132017 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.
Synopsis
 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
 class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where
 setDuplication :: Duplication > m ()
 restrictJoin :: Predicate Flat > m ()
 query' :: Relation p r > m (PlaceHolders p, Record Flat r)
 queryMaybe' :: Relation p r > m (PlaceHolders p, Record Flat (Maybe r))
 class MonadQuery m => MonadAggregate m where
 groupBy :: Record Flat r > m (Record Aggregated r)
 groupBy' :: AggregateKey (Record Aggregated r) > m (Record Aggregated r)
 class Monad m => MonadPartition c m where
 partitionBy :: Record c r > m ()
 all' :: MonadQuery m => m ()
 distinct :: MonadQuery m => m ()
 on :: MonadQuery m => Predicate Flat > m ()
 wheres :: MonadRestrict Flat m => Predicate Flat > m ()
 having :: MonadRestrict Aggregated m => Predicate Aggregated > 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
.
Instances
class (Functor m, Monad m) => MonadRestrict c m where Source #
Restrict context interface
Add restriction to this context.
Instances
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) Source #  Aggregated 
Defined in Database.Relational.Monad.Trans.Aggregating restrict :: Predicate c > AggregatingSetT m () Source #  
(Monad q, Functor q) => MonadRestrict c (Restrictings c q) Source # 

Defined in Database.Relational.Monad.Trans.Restricting restrict :: Predicate c > Restrictings c q () Source #  
MonadRestrict rc m => MonadRestrict rc (Orderings c m) Source # 

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

Defined in Database.Relational.Monad.Trans.Assigning restrict :: Predicate c > Assignings r m () Source #  
MonadRestrict Flat q => MonadRestrict Flat (Restrictings Aggregated q) Source #  Restricted 
Defined in Database.Relational.Monad.Aggregate restrict :: Predicate Flat > Restrictings Aggregated q () Source # 
class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where Source #
Query building interface.
setDuplication :: Duplication > m () Source #
Specify duplication.
Add restriction to last join.
query' :: Relation p r > m (PlaceHolders p, Record Flat r) Source #
Join subquery with placeholder parameter p
. query result is not Maybe
.
queryMaybe' :: Relation p r > m (PlaceHolders p, Record Flat (Maybe r)) Source #
Join subquery with placeholder parameter p
. Query result is Maybe
.
Instances
class MonadQuery m => MonadAggregate m where Source #
Aggregated query building interface extends MonadQuery
.
:: Record Flat r  Record to add into group by 
> m (Record Aggregated r)  Result context and aggregated record  Add GROUP BY term into context and get aggregated record. Nontraditional groupby version. 
Add GROUP BY term into context and get aggregated record.
:: AggregateKey (Record Aggregated r)  Key to aggretate for nontraditional groupby interface 
> m (Record Aggregated r)  Result context and aggregated record 
Instances
MonadQuery m => MonadAggregate (AggregatingSetT m) Source #  Aggregated query instance. 
Defined in Database.Relational.Monad.Trans.Aggregating groupBy :: Record Flat r > AggregatingSetT m (Record Aggregated r) Source # groupBy' :: AggregateKey (Record Aggregated r) > AggregatingSetT m (Record Aggregated r) Source #  
MonadAggregate m => MonadAggregate (Restrictings c m) Source #  Resticted 
Defined in Database.Relational.Monad.Trans.Restricting groupBy :: Record Flat r > Restrictings c m (Record Aggregated r) Source # groupBy' :: AggregateKey (Record Aggregated r) > Restrictings c m (Record Aggregated r) Source #  
MonadAggregate m => MonadAggregate (Orderings c m) Source # 

Defined in Database.Relational.Monad.Trans.Ordering groupBy :: Record Flat r > Orderings c m (Record Aggregated r) Source # groupBy' :: AggregateKey (Record Aggregated r) > Orderings c m (Record Aggregated r) Source # 
class Monad m => MonadPartition c m where Source #
Window specification building interface.
partitionBy :: Record c r > m () Source #
Add PARTITION BY term into context.
Instances
MonadPartition c m => MonadPartition c (Orderings c m) Source # 

Defined in Database.Relational.Monad.Trans.Ordering partitionBy :: Record c r > Orderings c m () Source #  
Monad m => MonadPartition c (PartitioningSetT c m) Source #  Partition clause instance 
Defined in Database.Relational.Monad.Trans.Aggregating partitionBy :: Record c r > PartitioningSetT 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 => Predicate Flat > m () Source #
Add restriction to last join. Record type version.
wheres :: MonadRestrict Flat m => Predicate Flat > m () Source #
Add restriction to this not aggregated query.
having :: MonadRestrict Aggregated m => Predicate Aggregated > m () Source #
Add restriction to this aggregated query. Aggregated Record type version.