Copyright | 2013-2017 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
- class (Functor m, Monad m) => MonadRestrict c m where
- class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery m where
- class MonadQuery m => MonadAggregate m where
- class Monad m => MonadPartition c m where
- all' :: MonadQuery m => m ()
- distinct :: MonadQuery m => m ()
- on :: MonadQuery m => Projection Flat (Maybe Bool) -> m ()
- wheres :: MonadRestrict Flat m => Projection Flat (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 (Assignings r m) Source # |
|
MonadQualify q m => MonadQualify q (Orderings c 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
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) Source # | Aggregated |
MonadRestrict c m => MonadRestrict c (Assignings r m) Source # |
|
MonadRestrict rc m => MonadRestrict rc (Orderings c 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.
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
.
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
.
groupBy :: Projection Flat r -> m (Projection Aggregated r) Source #
Add GROUP BY term into context and get aggregated projection.
groupBy' :: AggregateKey (Projection Aggregated r) -> m (Projection Aggregated r) Source #
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.
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.