packages feed

relational-record 0.1.8.0 → 0.2.0.0

raw patch · 3 files changed

+434/−432 lines, 3 filesdep +product-isomorphicdep ~persistable-recorddep ~relational-queryPVP ok

version bump matches the API change (PVP)

Dependencies added: product-isomorphic

Dependency ranges changed: persistable-record, relational-query

API changes (from Hackage documentation)

- Database.Relational.Query.Documentation: (!) :: Projection c a -> Pi a b -> Projection c b
- Database.Relational.Query.Documentation: (.*.) :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p a -> p a -> p a
- Database.Relational.Query.Documentation: (.+.) :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p a -> p a -> p a
- Database.Relational.Query.Documentation: (.-.) :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p a -> p a -> p a
- Database.Relational.Query.Documentation: (./.) :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p a -> p a -> p a
- Database.Relational.Query.Documentation: (.<.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.<=.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.<>.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.=.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.>.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.>=.) :: (OperatorProjectable p, ProjectableShowSql p) => p ft -> p ft -> p (Maybe Bool)
- Database.Relational.Query.Documentation: (.||.) :: (OperatorProjectable p, ProjectableShowSql p, IsString a) => p a -> p a -> p a
- Database.Relational.Query.Documentation: (<-#) :: Monad m => AssignTarget r v -> Projection Flat v -> Assignings r m ()
- Database.Relational.Query.Documentation: (<.>) :: Pi a b -> Pi b c -> Pi a c
- Database.Relational.Query.Documentation: (<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c)
- Database.Relational.Query.Documentation: (<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c)
- Database.Relational.Query.Documentation: (><) :: ProjectableApplicative p => p a -> p b -> p (a, b)
- Database.Relational.Query.Documentation: (?!) :: Projection c (Maybe a) -> Pi a b -> Projection c (Maybe b)
- Database.Relational.Query.Documentation: (?!?) :: Projection c (Maybe a) -> Pi a (Maybe b) -> Projection c (Maybe b)
- Database.Relational.Query.Documentation: (?+?) :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p (Maybe a) -> p (Maybe a) -> p (Maybe a)
- Database.Relational.Query.Documentation: (|$|) :: (ProjectableFunctor p, ProductConstructor (a -> b)) => (a -> b) -> p a -> p b
- Database.Relational.Query.Documentation: (|*|) :: ProjectableApplicative p => p (a -> b) -> p a -> p b
- Database.Relational.Query.Documentation: aggregateRelation :: QueryAggregate (Projection Aggregated r) -> Relation () r
- Database.Relational.Query.Documentation: all' :: MonadQuery m => m ()
- Database.Relational.Query.Documentation: and' :: (OperatorProjectable p, ProjectableShowSql p) => p (Maybe Bool) -> p (Maybe Bool) -> p (Maybe Bool)
- Database.Relational.Query.Documentation: any' :: (AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat (Maybe Bool) -> p ac (Maybe Bool)
- Database.Relational.Query.Documentation: avg :: (Num a, Fractional b, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat a -> p ac (Maybe b)
- Database.Relational.Query.Documentation: bind :: ToSql SqlValue p => PreparedStatement p a -> p -> BoundStatement a
- Database.Relational.Query.Documentation: bindKeyUpdate :: ToSql SqlValue a => PreparedKeyUpdate p a -> a -> BoundStatement ()
- Database.Relational.Query.Documentation: case' :: (OperatorProjectable p, ProjectableShowSql p) => p a -> [(p a, p b)] -> p b -> p b
- Database.Relational.Query.Documentation: casesOrElse :: (OperatorProjectable p, ProjectableShowSql p) => [(p (Maybe Bool), p a)] -> p a -> p a
- Database.Relational.Query.Documentation: class FromSql q a
- Database.Relational.Query.Documentation: class ProductConstructor r
- Database.Relational.Query.Documentation: class ProjectableFunctor p => ProjectableApplicative (p :: * -> *)
- Database.Relational.Query.Documentation: class ProjectableFunctor (p :: * -> *)
- Database.Relational.Query.Documentation: class ShowConstantTermsSQL a
- Database.Relational.Query.Documentation: class ToSql q a
- Database.Relational.Query.Documentation: count :: (Integral b, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat a -> p ac b
- Database.Relational.Query.Documentation: cumeDist :: Projection OverWindow Double
- Database.Relational.Query.Documentation: data Aggregated :: *
- Database.Relational.Query.Documentation: data Exists :: *
- Database.Relational.Query.Documentation: data Flat :: *
- Database.Relational.Query.Documentation: data OverWindow :: *
- Database.Relational.Query.Documentation: data Pi r0 r1 :: * -> * -> *
- Database.Relational.Query.Documentation: data Projection c t :: * -> * -> *
- Database.Relational.Query.Documentation: data RecordFromSql q a :: * -> * -> *
- Database.Relational.Query.Documentation: data RecordToSql q a :: * -> * -> *
- Database.Relational.Query.Documentation: data Relation p r :: * -> * -> *
- Database.Relational.Query.Documentation: data Restriction p r :: * -> * -> *
- Database.Relational.Query.Documentation: data UpdateTarget p r :: * -> * -> *
- Database.Relational.Query.Documentation: denseRank :: Integral a => Projection OverWindow a
- Database.Relational.Query.Documentation: derivedDelete :: TableDerivable r => RestrictedStatement r (PlaceHolders p) -> Delete p
- Database.Relational.Query.Documentation: derivedInsert :: TableDerivable r => Pi r r' -> Insert r'
- Database.Relational.Query.Documentation: derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
- Database.Relational.Query.Documentation: derivedUpdate :: TableDerivable r => AssignStatement r (PlaceHolders p) -> Update p
- Database.Relational.Query.Documentation: distinct :: MonadQuery m => m ()
- Database.Relational.Query.Documentation: every :: (AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat (Maybe Bool) -> p ac (Maybe Bool)
- Database.Relational.Query.Documentation: except :: Relation () a -> Relation () a -> Relation () a
- Database.Relational.Query.Documentation: execute :: BoundStatement a -> IO (ExecutedStatement a)
- Database.Relational.Query.Documentation: executeNoFetch :: BoundStatement () -> IO Integer
- Database.Relational.Query.Documentation: exists :: (OperatorProjectable p, ProjectableShowSql p) => ListProjection (Projection Exists) r -> p (Maybe Bool)
- Database.Relational.Query.Documentation: fetch :: FromSql SqlValue a => ExecutedStatement a -> IO (Maybe a)
- Database.Relational.Query.Documentation: flattenMaybe :: ProjectableMaybe p => forall a. p (Maybe (Maybe a)) -> p (Maybe a)
- Database.Relational.Query.Documentation: fromIntegral' :: (SqlProjectable p, ProjectableShowSql p, Integral a, Num b) => p a -> p b
- Database.Relational.Query.Documentation: fromMaybe :: (OperatorProjectable (Projection c), ProjectableShowSql (Projection c), HasColumnConstraint NotNull r) => Projection c r -> Projection c (Maybe r) -> Projection c r
- Database.Relational.Query.Documentation: full :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation () (Maybe a, Maybe b)
- Database.Relational.Query.Documentation: groupBy :: MonadAggregate m => forall r. Projection Flat r -> m (Projection Aggregated r)
- Database.Relational.Query.Documentation: having :: MonadRestrict Aggregated m => Projection Aggregated (Maybe Bool) -> m ()
- Database.Relational.Query.Documentation: in' :: (OperatorProjectable p, ProjectableShowSql p) => p t -> ListProjection p t -> p (Maybe Bool)
- Database.Relational.Query.Documentation: infix 4 `like'`
- Database.Relational.Query.Documentation: infix 8 `over`
- Database.Relational.Query.Documentation: infixl 1 ><
- Database.Relational.Query.Documentation: infixl 5 .||.
- Database.Relational.Query.Documentation: infixl 6 ?+?
- Database.Relational.Query.Documentation: infixl 7 `union'`
- Database.Relational.Query.Documentation: infixl 8 `left'`
- Database.Relational.Query.Documentation: infixr 2 `or'`
- Database.Relational.Query.Documentation: infixr 3 `and'`
- Database.Relational.Query.Documentation: inner :: Relation () a -> Relation () b -> [JoinRestriction a b] -> Relation () (a, b)
- Database.Relational.Query.Documentation: intersect :: Relation () a -> Relation () a -> Relation () a
- Database.Relational.Query.Documentation: isJust :: (OperatorProjectable (Projection c), ProjectableShowSql (Projection c), HasColumnConstraint NotNull r) => Projection c (Maybe r) -> Projection c (Maybe Bool)
- Database.Relational.Query.Documentation: isNothing :: (OperatorProjectable (Projection c), ProjectableShowSql (Projection c), HasColumnConstraint NotNull r) => Projection c (Maybe r) -> Projection c (Maybe Bool)
- Database.Relational.Query.Documentation: just :: ProjectableMaybe p => forall a. p a -> p (Maybe a)
- Database.Relational.Query.Documentation: left :: Relation () a -> Relation () b -> [JoinRestriction a (Maybe b)] -> Relation () (a, Maybe b)
- Database.Relational.Query.Documentation: left' :: Relation pa a -> Relation pb b -> [JoinRestriction a (Maybe b)] -> Relation (pa, pb) (a, Maybe b)
- Database.Relational.Query.Documentation: like :: (OperatorProjectable p, ProjectableShowSql p, IsString a, ShowConstantTermsSQL a) => p a -> a -> p (Maybe Bool)
- Database.Relational.Query.Documentation: like' :: (OperatorProjectable p, ProjectableShowSql p, IsString a) => p a -> p a -> p (Maybe Bool)
- Database.Relational.Query.Documentation: max' :: (Ord a, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat a -> p ac (Maybe a)
- Database.Relational.Query.Documentation: min' :: (Ord a, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat a -> p ac (Maybe a)
- Database.Relational.Query.Documentation: negate' :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p a -> p a
- Database.Relational.Query.Documentation: negateMaybe :: (OperatorProjectable p, ProjectableShowSql p, Num a) => p (Maybe a) -> p (Maybe a)
- Database.Relational.Query.Documentation: not' :: (OperatorProjectable p, ProjectableShowSql p) => p (Maybe Bool) -> p (Maybe Bool)
- Database.Relational.Query.Documentation: on :: MonadQuery m => Projection Flat (Maybe Bool) -> m ()
- Database.Relational.Query.Documentation: on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b)
- Database.Relational.Query.Documentation: or' :: (OperatorProjectable p, ProjectableShowSql p) => p (Maybe Bool) -> p (Maybe Bool) -> p (Maybe Bool)
- Database.Relational.Query.Documentation: over :: SqlProjectable (Projection c) => Projection OverWindow a -> Window c () -> Projection c a
- Database.Relational.Query.Documentation: percentRank :: Projection OverWindow Double
- Database.Relational.Query.Documentation: placeholder :: (PersistableWidth t, SqlProjectable p, Monad m) => (p t -> m a) -> m (PlaceHolders t, a)
- Database.Relational.Query.Documentation: prepareDelete :: IConnection conn => conn -> Delete p -> IO (PreparedDelete p)
- Database.Relational.Query.Documentation: prepareInsert :: IConnection conn => conn -> Insert a -> IO (PreparedInsert a)
- Database.Relational.Query.Documentation: prepareInsertQuery :: IConnection conn => conn -> InsertQuery p -> IO (PreparedInsertQuery p)
- Database.Relational.Query.Documentation: prepareKeyUpdate :: IConnection conn => conn -> KeyUpdate p a -> IO (PreparedKeyUpdate p a)
- Database.Relational.Query.Documentation: prepareNoFetch :: (UntypeableNoFetch s, IConnection conn) => conn -> s p -> IO (PreparedStatement p ())
- Database.Relational.Query.Documentation: prepareQuery :: IConnection conn => conn -> Query p a -> IO (PreparedQuery p a)
- Database.Relational.Query.Documentation: prepareUpdate :: IConnection conn => conn -> Update p -> IO (PreparedUpdate p)
- Database.Relational.Query.Documentation: query :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Projection Flat r)
- Database.Relational.Query.Documentation: query' :: MonadQuery m => forall p r. Relation p r -> m (PlaceHolders p, Projection Flat r)
- Database.Relational.Query.Documentation: queryMaybe :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Projection Flat (Maybe r))
- Database.Relational.Query.Documentation: rank :: Integral a => Projection OverWindow a
- Database.Relational.Query.Documentation: relation :: QuerySimple (Projection Flat r) -> Relation () r
- Database.Relational.Query.Documentation: relation' :: SimpleQuery p r -> Relation p r
- Database.Relational.Query.Documentation: relationalQuery :: Relation p r -> Query p r
- Database.Relational.Query.Documentation: restriction :: RestrictedStatement r () -> Restriction () r
- Database.Relational.Query.Documentation: restriction' :: RestrictedStatement r (PlaceHolders p) -> Restriction p r
- Database.Relational.Query.Documentation: right :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) b] -> Relation () (Maybe a, b)
- Database.Relational.Query.Documentation: rowNumber :: Integral a => Projection OverWindow a
- Database.Relational.Query.Documentation: runDelete :: (IConnection conn, ToSql SqlValue p) => conn -> Delete p -> p -> IO Integer
- Database.Relational.Query.Documentation: runInsert :: (IConnection conn, ToSql SqlValue a) => conn -> Insert a -> a -> IO Integer
- Database.Relational.Query.Documentation: runInsertQuery :: (IConnection conn, ToSql SqlValue p) => conn -> InsertQuery p -> p -> IO Integer
- Database.Relational.Query.Documentation: runKeyUpdate :: (IConnection conn, ToSql SqlValue a) => conn -> KeyUpdate p a -> a -> IO Integer
- Database.Relational.Query.Documentation: runQuery :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
- Database.Relational.Query.Documentation: runQuery' :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
- Database.Relational.Query.Documentation: runUpdate :: (IConnection conn, ToSql SqlValue p) => conn -> Update p -> p -> IO Integer
- Database.Relational.Query.Documentation: showNum :: (SqlProjectable p, ProjectableShowSql p, Num a, IsString b) => p a -> p b
- Database.Relational.Query.Documentation: some' :: (AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat (Maybe Bool) -> p ac (Maybe Bool)
- Database.Relational.Query.Documentation: sum' :: (Num a, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat a -> p ac (Maybe a)
- Database.Relational.Query.Documentation: sumMaybe :: (Num a, AggregatedContext ac, SqlProjectable (p ac)) => Projection Flat (Maybe a) -> p ac (Maybe a)
- Database.Relational.Query.Documentation: type JoinRestriction a b = Projection Flat a -> Projection Flat b -> Projection Flat (Maybe Bool)
- Database.Relational.Query.Documentation: typedDelete :: Table r -> Restriction p r -> Delete p
- Database.Relational.Query.Documentation: typedInsert :: Table r -> Pi r r' -> Insert r'
- Database.Relational.Query.Documentation: typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p
- Database.Relational.Query.Documentation: typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a
- Database.Relational.Query.Documentation: typedUpdate :: Table r -> UpdateTarget p r -> Update p
- Database.Relational.Query.Documentation: union :: Relation () a -> Relation () a -> Relation () a
- Database.Relational.Query.Documentation: union' :: Relation p a -> Relation q a -> Relation (p, q) a
- Database.Relational.Query.Documentation: updateTarget :: AssignStatement r () -> UpdateTarget () r
- Database.Relational.Query.Documentation: updateTarget' :: AssignStatement r (PlaceHolders p) -> UpdateTarget p r
- Database.Relational.Query.Documentation: value :: (ShowConstantTermsSQL t, OperatorProjectable p) => t -> p t
- Database.Relational.Query.Documentation: values :: (ShowConstantTermsSQL t, OperatorProjectable p) => [t] -> ListProjection p t
- Database.Relational.Query.Documentation: wheres :: MonadRestrict Flat m => Projection Flat (Maybe Bool) -> m ()
+ Database.Relational.Documentation: (!) :: PersistableWidth a => Record c a -> Pi a b -> Record c b
+ Database.Relational.Documentation: (.*.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
+ Database.Relational.Documentation: (.+.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
+ Database.Relational.Documentation: (.-.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
+ Database.Relational.Documentation: (./.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
+ Database.Relational.Documentation: (.<.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.<=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.<>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.>=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
+ Database.Relational.Documentation: (.||.) :: OperatorContext c => Record c a -> Record c a -> Record c a
+ Database.Relational.Documentation: (<-#) :: Monad m => AssignTarget r v -> Record Flat v -> Assignings r m ()
+ Database.Relational.Documentation: (<.>) :: Pi a b -> Pi b c -> Pi a c
+ Database.Relational.Documentation: (<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c)
+ Database.Relational.Documentation: (<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c)
+ Database.Relational.Documentation: (><) :: ProductIsoApplicative p => p a -> p b -> p (a, b)
+ Database.Relational.Documentation: (?!) :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
+ Database.Relational.Documentation: (?!?) :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
+ Database.Relational.Documentation: (?+?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
+ Database.Relational.Documentation: (|$|) :: (ProductIsoFunctor f, ProductConstructor (a -> b)) => (a -> b) -> f a -> f b
+ Database.Relational.Documentation: (|*|) :: ProductIsoApplicative f => f (a -> b) -> f a -> f b
+ Database.Relational.Documentation: aggregateRelation :: QueryAggregate (Record Aggregated r) -> Relation () r
+ Database.Relational.Documentation: all' :: MonadQuery m => m ()
+ Database.Relational.Documentation: and' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
+ Database.Relational.Documentation: any' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
+ Database.Relational.Documentation: avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b)
+ Database.Relational.Documentation: bind :: ToSql SqlValue p => PreparedStatement p a -> p -> BoundStatement a
+ Database.Relational.Documentation: bindKeyUpdate :: ToSql SqlValue a => PreparedKeyUpdate p a -> a -> BoundStatement ()
+ Database.Relational.Documentation: case' :: OperatorContext c => Record c a -> [(Record c a, Record c b)] -> Record c b -> Record c b
+ Database.Relational.Documentation: casesOrElse :: OperatorContext c => [(Predicate c, Record c a)] -> Record c a -> Record c a
+ Database.Relational.Documentation: class FromSql q a
+ Database.Relational.Documentation: class ProductConstructor c
+ Database.Relational.Documentation: class ProductIsoFunctor f => ProductIsoApplicative (f :: * -> *)
+ Database.Relational.Documentation: class ProductIsoFunctor (f :: * -> *)
+ Database.Relational.Documentation: class ShowConstantTermsSQL a
+ Database.Relational.Documentation: class PersistableWidth a => ToSql q a
+ Database.Relational.Documentation: count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b
+ Database.Relational.Documentation: cumeDist :: Record OverWindow Double
+ Database.Relational.Documentation: data Aggregated :: *
+ Database.Relational.Documentation: data Exists :: *
+ Database.Relational.Documentation: data Flat :: *
+ Database.Relational.Documentation: data OverWindow :: *
+ Database.Relational.Documentation: data Pi r0 r1 :: * -> * -> *
+ Database.Relational.Documentation: data Record c t :: * -> * -> *
+ Database.Relational.Documentation: data RecordFromSql q a :: * -> * -> *
+ Database.Relational.Documentation: data RecordToSql q a :: * -> * -> *
+ Database.Relational.Documentation: data Relation p r :: * -> * -> *
+ Database.Relational.Documentation: data Restriction p r :: * -> * -> *
+ Database.Relational.Documentation: data UpdateTarget p r :: * -> * -> *
+ Database.Relational.Documentation: denseRank :: Integral a => Record OverWindow a
+ Database.Relational.Documentation: derivedDelete :: TableDerivable r => RestrictedStatement r (PlaceHolders p) -> Delete p
+ Database.Relational.Documentation: derivedInsert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r'
+ Database.Relational.Documentation: derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
+ Database.Relational.Documentation: derivedUpdate :: TableDerivable r => AssignStatement r (PlaceHolders p) -> Update p
+ Database.Relational.Documentation: distinct :: MonadQuery m => m ()
+ Database.Relational.Documentation: every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
+ Database.Relational.Documentation: except :: Relation () a -> Relation () a -> Relation () a
+ Database.Relational.Documentation: execute :: BoundStatement a -> IO (ExecutedStatement a)
+ Database.Relational.Documentation: executeNoFetch :: BoundStatement () -> IO Integer
+ Database.Relational.Documentation: exists :: OperatorContext c => RecordList (Record Exists) r -> Record c (Maybe Bool)
+ Database.Relational.Documentation: fetch :: FromSql SqlValue a => ExecutedStatement a -> IO (Maybe a)
+ Database.Relational.Documentation: flattenMaybe :: ProjectableMaybe p => forall a. p (Maybe (Maybe a)) -> p (Maybe a)
+ Database.Relational.Documentation: fromIntegral' :: (SqlContext c, Integral a, Num b) => Record c a -> Record c b
+ Database.Relational.Documentation: fromMaybe :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c r -> Record c (Maybe r) -> Record c r
+ Database.Relational.Documentation: full :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation () (Maybe a, Maybe b)
+ Database.Relational.Documentation: groupBy :: MonadAggregate m => forall r. Record Flat r -> m (Record Aggregated r)
+ Database.Relational.Documentation: having :: MonadRestrict Aggregated m => Predicate Aggregated -> m ()
+ Database.Relational.Documentation: in' :: OperatorContext c => Record c t -> RecordList (Record c) t -> Record c (Maybe Bool)
+ Database.Relational.Documentation: infix 4 `like'`
+ Database.Relational.Documentation: infix 8 `over`
+ Database.Relational.Documentation: infixl 1 ><
+ Database.Relational.Documentation: infixl 5 .||.
+ Database.Relational.Documentation: infixl 6 ?+?
+ Database.Relational.Documentation: infixl 7 `union'`
+ Database.Relational.Documentation: infixl 8 `left'`
+ Database.Relational.Documentation: infixr 2 `or'`
+ Database.Relational.Documentation: infixr 3 `and'`
+ Database.Relational.Documentation: inner :: Relation () a -> Relation () b -> [JoinRestriction a b] -> Relation () (a, b)
+ Database.Relational.Documentation: intersect :: Relation () a -> Relation () a -> Relation () a
+ Database.Relational.Documentation: isJust :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
+ Database.Relational.Documentation: isNothing :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
+ Database.Relational.Documentation: just :: ProjectableMaybe p => forall a. p a -> p (Maybe a)
+ Database.Relational.Documentation: left :: Relation () a -> Relation () b -> [JoinRestriction a (Maybe b)] -> Relation () (a, Maybe b)
+ Database.Relational.Documentation: left' :: Relation pa a -> Relation pb b -> [JoinRestriction a (Maybe b)] -> Relation (pa, pb) (a, Maybe b)
+ Database.Relational.Documentation: like :: (OperatorContext c, IsString a, ShowConstantTermsSQL a) => Record c a -> a -> Record c (Maybe Bool)
+ Database.Relational.Documentation: like' :: (OperatorContext c, IsString a) => Record c a -> Record c a -> Record c (Maybe Bool)
+ Database.Relational.Documentation: max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
+ Database.Relational.Documentation: min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
+ Database.Relational.Documentation: negate' :: (OperatorContext c, Num a) => Record c a -> Record c a
+ Database.Relational.Documentation: negateMaybe :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a)
+ Database.Relational.Documentation: not' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool)
+ Database.Relational.Documentation: on :: MonadQuery m => Predicate Flat -> m ()
+ Database.Relational.Documentation: on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b)
+ Database.Relational.Documentation: or' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
+ Database.Relational.Documentation: over :: SqlContext c => Record OverWindow a -> Window c () -> Record c a
+ Database.Relational.Documentation: percentRank :: Record OverWindow Double
+ Database.Relational.Documentation: placeholder :: (PersistableWidth t, SqlContext c, Monad m) => (Record c t -> m a) -> m (PlaceHolders t, a)
+ Database.Relational.Documentation: prepareDelete :: IConnection conn => conn -> Delete p -> IO (PreparedDelete p)
+ Database.Relational.Documentation: prepareInsert :: IConnection conn => conn -> Insert a -> IO (PreparedInsert a)
+ Database.Relational.Documentation: prepareInsertQuery :: IConnection conn => conn -> InsertQuery p -> IO (PreparedInsertQuery p)
+ Database.Relational.Documentation: prepareKeyUpdate :: IConnection conn => conn -> KeyUpdate p a -> IO (PreparedKeyUpdate p a)
+ Database.Relational.Documentation: prepareNoFetch :: (UntypeableNoFetch s, IConnection conn) => conn -> s p -> IO (PreparedStatement p ())
+ Database.Relational.Documentation: prepareQuery :: IConnection conn => conn -> Query p a -> IO (PreparedQuery p a)
+ Database.Relational.Documentation: prepareUpdate :: IConnection conn => conn -> Update p -> IO (PreparedUpdate p)
+ Database.Relational.Documentation: pureP :: (ProductIsoApplicative f, ProductConstructor a) => a -> f a
+ Database.Relational.Documentation: query :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat r)
+ Database.Relational.Documentation: query' :: MonadQuery m => forall p r. Relation p r -> m (PlaceHolders p, Record Flat r)
+ Database.Relational.Documentation: queryMaybe :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat (Maybe r))
+ Database.Relational.Documentation: rank :: Integral a => Record OverWindow a
+ Database.Relational.Documentation: relation :: QuerySimple (Record Flat r) -> Relation () r
+ Database.Relational.Documentation: relation' :: SimpleQuery p r -> Relation p r
+ Database.Relational.Documentation: relationalQuery :: Relation p r -> Query p r
+ Database.Relational.Documentation: restriction :: RestrictedStatement r () -> Restriction () r
+ Database.Relational.Documentation: restriction' :: RestrictedStatement r (PlaceHolders p) -> Restriction p r
+ Database.Relational.Documentation: right :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) b] -> Relation () (Maybe a, b)
+ Database.Relational.Documentation: rowNumber :: Integral a => Record OverWindow a
+ Database.Relational.Documentation: runDelete :: (IConnection conn, ToSql SqlValue p) => conn -> Delete p -> p -> IO Integer
+ Database.Relational.Documentation: runInsert :: (IConnection conn, ToSql SqlValue a) => conn -> Insert a -> a -> IO Integer
+ Database.Relational.Documentation: runInsertQuery :: (IConnection conn, ToSql SqlValue p) => conn -> InsertQuery p -> p -> IO Integer
+ Database.Relational.Documentation: runKeyUpdate :: (IConnection conn, ToSql SqlValue a) => conn -> KeyUpdate p a -> a -> IO Integer
+ Database.Relational.Documentation: runQuery :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
+ Database.Relational.Documentation: runQuery' :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
+ Database.Relational.Documentation: runUpdate :: (IConnection conn, ToSql SqlValue p) => conn -> Update p -> p -> IO Integer
+ Database.Relational.Documentation: showNum :: (SqlContext c, Num a, IsString b) => Record c a -> Record c b
+ Database.Relational.Documentation: some' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
+ Database.Relational.Documentation: sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
+ Database.Relational.Documentation: sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
+ Database.Relational.Documentation: type JoinRestriction a b = Record Flat a -> Record Flat b -> Predicate Flat
+ Database.Relational.Documentation: typedDelete :: Table r -> Restriction p r -> Delete p
+ Database.Relational.Documentation: typedInsert :: PersistableWidth r => Table r -> Pi r r' -> Insert r'
+ Database.Relational.Documentation: typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p
+ Database.Relational.Documentation: typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a
+ Database.Relational.Documentation: typedUpdate :: Table r -> UpdateTarget p r -> Update p
+ Database.Relational.Documentation: union :: Relation () a -> Relation () a -> Relation () a
+ Database.Relational.Documentation: union' :: Relation p a -> Relation q a -> Relation (p, q) a
+ Database.Relational.Documentation: updateTarget :: AssignStatement r () -> UpdateTarget () r
+ Database.Relational.Documentation: updateTarget' :: AssignStatement r (PlaceHolders p) -> UpdateTarget p r
+ Database.Relational.Documentation: value :: (ShowConstantTermsSQL t, OperatorContext c) => t -> Record c t
+ Database.Relational.Documentation: values :: (ShowConstantTermsSQL t, OperatorContext c) => [t] -> RecordList (Record c) t
+ Database.Relational.Documentation: wheres :: MonadRestrict Flat m => Predicate Flat -> m ()

Files

relational-record.cabal view
@@ -1,5 +1,5 @@ name:                relational-record-version:             0.1.8.0+version:             0.2.0.0 synopsis:            Meta package of Relational Record description:         Meta package to install Relational Record quickly homepage:            http://khibino.github.io/haskell-relational-record/@@ -14,11 +14,12 @@  library   exposed-modules:-                     Database.Relational.Query.Documentation+                     Database.Relational.Documentation    build-depends:       base <5-                     , persistable-record >= 0.5-                     , relational-query >=0.9+                     , product-isomorphic >= 0.0.3+                     , persistable-record >= 0.6+                     , relational-query >=0.10                      , relational-query-HDBC                      , persistable-types-HDBC-pg 
+ src/Database/Relational/Documentation.hs view
@@ -0,0 +1,429 @@+-- |+-- Module      : Database.Relational.Documentation+-- Copyright   : 2014-2017 Kei Hibino+-- License     : BSD3+--+-- Maintainer  : ex8k.hibino@gmail.com+-- Stability   : experimental+-- Portability : unknown+--+-- This module is documentation module for relational-record.+-- The project page of relational-record is+-- http://khibino.github.io/haskell-relational-record/ .+module Database.Relational.Documentation (+  -- * Concepts+  -- $concepts++  -- * Relational Query Building DSL+  -- $queryBuildingDSL++  -- ** Monadic Query Context Building+  -- $monadicContext++  -- *** Monadic Operators+  -- $monadicOperator+  query,+  queryMaybe,++  on,+  wheres,++  groupBy,++  having,++  distinct,+  all',++  (<-#),++  -- *** Direct Join Operators+  -- $directJoin+  inner, left, right, full,+  on',++  JoinRestriction,++  -- *** Finalize Context+  -- $finalize+  Relation,+  relation,+  aggregateRelation,++  UpdateTarget, updateTarget,+  Restriction, restriction,++  -- ** Record+  -- $record++  -- *** Record Type+  -- $recordType+  Record,++  Flat, Aggregated,++  Exists, OverWindow,++  -- *** Projection Path+  -- $projectionPath+  Pi, (!), (<.>),++  -- *** Projection Operators+  -- $recordOperators+  ShowConstantTermsSQL,++  value, values,++  (.=.), (.<.), (.<=.), (.>.), (.>=.), (.<>.),++  and', or', in',++  (.||.), like, like',+  (.+.), (.-.), (.*.), (./.),++  isNothing, isJust, fromMaybe,++  not', exists,++  negate', fromIntegral', showNum,++  casesOrElse, case',++  -- ** Aggregate and Window Functions+  -- $aggregateFunctions+  count,+  sum', avg,+  max', min',+  every, any', some',++  over,++  rank, denseRank, rowNumber, percentRank, cumeDist,++  -- ** Set Operators+  -- $setOperators+  union, except, intersect,++  -- ** Maybe Records+  -- $maybeRecord+  just, flattenMaybe,++  (?!), (?!?),+  (<?.>), (<?.?>),++  (?+?),+  negateMaybe,+  sumMaybe,++  -- ** Placeholders+  -- $placeholders+  placeholder,++  query',+  left',+  relation',+  updateTarget',+  restriction',+  union',++  -- ** Record Mapping+  -- $recordMapping+  ProductConstructor,+  ProductIsoFunctor (..),+  ProductIsoApplicative (..),+  (><),++  -- ** Database Statements+  -- $databaseStatements+  relationalQuery,+  typedInsert,+  typedInsertQuery,+  typedUpdate,+  typedDelete,+  typedKeyUpdate,++  derivedInsert,+  derivedInsertQuery,+  derivedUpdate,+  derivedDelete,++  -- * Database Operations+  -- $databaseOperations++  -- ** Conversion interfaces to communicate with database+  -- $conversionInterfaces+  FromSql, ToSql,+  RecordFromSql, RecordToSql,++  -- ** Generalized Statement+  -- $generalizedStmt+  prepareNoFetch,+  bind,+  execute,+  executeNoFetch,++  -- ** Select+  -- $select+  prepareQuery,+  fetch,+  runQuery,+  runQuery',++  -- ** Insert Values+  -- $insertValue+  prepareInsert,+  runInsert,++  -- ** Insert Select Results+  -- $insertSelect+  prepareInsertQuery,+  runInsertQuery,++  -- ** Update+  -- $update+  prepareUpdate,+  runUpdate,++  -- ** Delete+  -- $delete+  prepareDelete,+  runDelete,++  -- ** Update by Key+  -- $keyUpdate+  prepareKeyUpdate,+  bindKeyUpdate,+  runKeyUpdate,++  ) where++import Data.Functor.ProductIsomorphic+import Database.Relational+import Database.Record (RecordFromSql, FromSql, RecordToSql, ToSql)+import Database.HDBC.Record++{- $concepts+User interface of Relational Record has main two part of modules.++[@"Database.Relational"@] Relational Query Building DSL++[@"Database.Record" and "Database.HDBC.Record"@] Database Operation Actions+ -}++{- $queryBuildingDSL+Relational Query ("Database.Relational") module+defines Typed DSL to build complex SQL query.+ -}++{- $monadicContext+On building query, query structures can be accumulated in monadic context.+ -}++{- $monadicOperator+Some operators are defined to build query structures in monadic context.++'query' and 'queryMaybe' operators grow query product of monadic context like join operation of SQL.+'on' operator appends a new condition into recent join product condition.++'groupBy' operator aggregates flat record value, and can be used only in 'MonadAggregate' context.++'wheres' and 'having' operators appends a new condition into whole query condition.+'having' only accepts aggregated record value, and can be used only in 'MonadRestrict' 'Aggregated' context.++'distinct' operator and 'all'' operator specify SELECT DISTINCT or SELECT ALL, the last specified in monad is used.++'<-#' operator assigns update target column and record value to build update statement structure.+ -}++{- $directJoin+Not monadic style join is supported by some direct join operators.++'inner', 'left', 'right', 'full' operators can construct join products directly like SQL.+'inner' operator is INNER JOIN of SQL, 'left' operator is LEFT OUTER JOIN of SQL, and so on.+'on'' operator specifies condition of join product.+'JoinRestriction' is the type of lambda form which expresses condition of join product.+ -}++{- $finalize+Several operators are defined to make 'Relation' type with finalizing query monadic context.++'relation' operator finalizes flat (not aggregated) query monadic context,+and 'aggregateRelation' operator finalizes aggregated query monadic context.+Both operator convert monadic context into 'Relation' type,+and finalized 'Relation' can be reused as joining and sub-querying in another queries.++'updateTarget' operator finalize monadic context into 'UpdateTarget' type+which can be used as update statement.++'restriction' operator finalize monadic context into 'Restriction' type+which can be used as delete statement.+ -}++{- $record+SQL expression corresponds to Haskell record phantom type in this DSL.+ -}++{- $recordType+'Record' /c/ /a/ is projected SQL value type corresponding to Haskell record type /a/ with context type /c/.++'Flat' is not aggregated query context type,+'Aggregated' is aggregated query context type,+'OverWindow' is window function context type, and so on.++Module "Database.Relational.Context" contains documentation of other context types.+ -}++{- $projectionPath+'!' operator is record value selector using projection path type 'Pi' /r0/ /r1/.+'Pi' /r0/ /r1/ is projection path type selecting column type /r1/ from record type /r0/.+'<.>' operator makes composed projection path from two projection paths.+ -}++{- $recordOperators+Some operators are defined to calculate record values.++For example,+'value' operator lifts from Haskell value into 'Record' corresponding SQL row value,+which conversion is implicitly specified by 'ShowConstantTermsSQL' class.+Generic programming with default signature is available to define instances of 'ShowConstantTermsSQL'.++'values' operator converts from Haskell list value into 'RecordList', corresponding SQL set value,+'.=.' operator is equal compare operation of record value correspond to SQL =,+'.+.' operator is plus operation of record value correspond to SQL +, and so on.++Module "Database.Relational.Projectable" contains documentation of other record operators.+ -}++{- $aggregateFunctions+Typed aggregate function operators are defined.+Aggregated value types is distinguished with Flat value types.++For example,+'sum'' operator is aggregate function of flat (not aggregated) record value+correspond to SQL SUM(...),+'rank' operator is window function of record value correspond to SQL RANK(), and so on.++To convert window function result into normal record, use the 'over' operator with built 'Window' monad.++Module "Database.Relational.Projectable" contains documentation of+other aggregate function operators and window function operators.+ -}++{- $setOperators+Several operators are defined to manipulate relation set.++'union' operator makes union relation set of two relation set correspond to SQL UNION.+'except' operator makes difference relation set of two relation set correspond to SQL EXCEPT.+'intersect' operator makes intersection relation set of two relation set correspond to SQL INTERSECT.+-}++{- $maybeRecord+Some operators are provided to manage records with 'Maybe' phantom type.++'just' operator creates 'Maybe' typed record,+'flattenMaybe' operator joins nested 'Maybe' typed record.++'Maybe' type flavor of operators against projection path, record and aggregation are also provided.++For example,+'?!' operator is maybe flavor of '!',+'<?.>' operator is maybe flavor of '<.>'.+'?!?' operator and '<?.?>' operator 'join' two 'Maybe' phantom functors.++'?+?' operator is maybe flavor of '.+.',+'negateMaybe' operator is maybe flavor of 'negate'',+'sumMaybe' operator is maybe flavor of 'sum''.++Module "Database.Relational.Projectable" and "Database.Relational.ProjectableExtended"+contain documentation of other 'Maybe' flavor operators.+ -}++{- $placeholders+'placeholders' operator takes+a lambda-form which argument is 'Record' typed placeholders and its scope is restricted by that lambda-form+and then creates dummy value with 'Placeholders' typed which propagate placeholder type information into 'Relation' layer.++Placeholders' flavor of operators against query operation and set operation are also provided, to realize type safe placeholders.++'query'', 'left'', 'relation'', 'updateTarget'', 'restriction'', and 'union''+operator are placeholders' flavor 'query', 'left', 'relation', 'updateTarget', 'restriction' and 'union'.++Module "Database.Relational.Relation" and "Database.Relational.Effect"+contains documentation of other placeholders' flavor operators.+-}++{- $recordMapping+Applicative style record mapping is supported, for 'Record', 'Pi' and 'PlaceHolders'.+'|$|' operator can be used on 'ProductIsoFunctor' context, and+'|*|' operator can be used on 'ProductIsoApplicative' context with 'ProductConstructor',+like /Foo |$| record1 |*| record2 |*| record3/+, /Foo |$| placeholders1 |*| placeholders2 |*| placeholders3/, and so on.++'><' operator constructs pair result. /x >< y/ is the same as /(,) |$| x |*| y/.+ -}++{- $databaseStatements+Some functions are defined to expand query structure+into flat SQL statements to be used by database operation.++'relationalQuery' function converts 'Relation' type info flat SQL query like SELECT statement.++'typedInsert' function converts 'Pi' key type info flat SQL INSERT statement.++'typedInsertQuery' function converts 'Pi' key type and 'Relation' type info flat SQL INSERT ... SELECT ... statement.++'typedUpdate' function converts 'UpdateTarget' type into flat SQL UPDATE statement.++'typedDelete' function converts 'Restriction' into flat SQL DELETE statement.++'typedKeyUpdate' function converts 'Pi' key type info flat SQL UPDATE statement.++Some handy table type inferred functions are provided,+'derivedInsert', 'derivedInsertQuery', 'derivedUpdate' and 'derivedDelete'.+ -}+++{- $databaseOperations+Some HDBC actions are defined for database side effects.+ -}++{- $conversionInterfaces+Some record conversion interfaces are defined to communicate with database.++The conversions are implicitly specified by 'FromSql' class and 'ToSql' class.+Generic programming with default signature is available to define instances of 'FromSql' and 'ToSql'.++The explicit definitions correnponsing those classes are 'RecordFromSql' and 'RecordToSql'.++-}++{- $generalizedStmt+Actions to manage generalized SQL statements.+ -}++{- $select+Actions to manage SELECT statements.++'runQuery' function is lazy-read and 'runQuery'' function is strict version,+please use carefully.+ -}++{- $insertValue+Actions to manage INSERT ... VALUES ... statements.+ -}++{- $insertSelect+Actions to manage INSERT ... SELECT ... statements.+ -}++{- $update+Actions to manage UPDATE statements.+ -}++{- $delete+Actions to manage DELETE statements.+ -}++{- $keyUpdate+Actions to manage UPDATE statements which updates columns other than specified key of the records selected by specified key.+ -}
− src/Database/Relational/Query/Documentation.hs
@@ -1,428 +0,0 @@--- |--- Module      : Database.Relational.Query.Documentation--- Copyright   : 2014-2017 Kei Hibino--- License     : BSD3------ Maintainer  : ex8k.hibino@gmail.com--- Stability   : experimental--- Portability : unknown------ This module is documentation module for relational-record.--- The project page of relational-record is--- http://khibino.github.io/haskell-relational-record/ .-module Database.Relational.Query.Documentation (-  -- * Concepts-  -- $concepts--  -- * Relational Query Building DSL-  -- $queryBuildingDSL--  -- ** Monadic Query Context Building-  -- $monadicContext--  -- *** Monadic Operators-  -- $monadicOperator-  query,-  queryMaybe,--  on,-  wheres,--  groupBy,--  having,--  distinct,-  all',--  (<-#),--  -- *** Direct Join Operators-  -- $directJoin-  inner, left, right, full,-  on',--  JoinRestriction,--  -- *** Finalize Context-  -- $finalize-  Relation,-  relation,-  aggregateRelation,--  UpdateTarget, updateTarget,-  Restriction, restriction,--  -- ** Projection-  -- $projection--  -- *** Projection Type-  -- $projectionType-  Projection,--  Flat, Aggregated,--  Exists, OverWindow,--  -- *** Projection Path-  -- $projectionPath-  Pi, (!), (<.>),--  -- *** Projection Operators-  -- $projectionOperators-  ShowConstantTermsSQL,--  value, values,--  (.=.), (.<.), (.<=.), (.>.), (.>=.), (.<>.),--  and', or', in',--  (.||.), like, like',-  (.+.), (.-.), (.*.), (./.),--  isNothing, isJust, fromMaybe,--  not', exists,--  negate', fromIntegral', showNum,--  casesOrElse, case',--  -- ** Aggregate and Window Functions-  -- $aggregateFunctions-  count,-  sum', avg,-  max', min',-  every, any', some',--  over,--  rank, denseRank, rowNumber, percentRank, cumeDist,--  -- ** Set Operators-  -- $setOperators-  union, except, intersect,--  -- ** Maybe Projections-  -- $maybeProjection-  just, flattenMaybe,--  (?!), (?!?),-  (<?.>), (<?.?>),--  (?+?),-  negateMaybe,-  sumMaybe,--  -- ** Placeholders-  -- $placeholders-  placeholder,--  query',-  left',-  relation',-  updateTarget',-  restriction',-  union',--  -- ** Record Mapping-  -- $recordMapping-  ProductConstructor,-  ProjectableFunctor (..),-  ProjectableApplicative (..),-  (><),--  -- ** Database Statements-  -- $databaseStatements-  relationalQuery,-  typedInsert,-  typedInsertQuery,-  typedUpdate,-  typedDelete,-  typedKeyUpdate,--  derivedInsert,-  derivedInsertQuery,-  derivedUpdate,-  derivedDelete,--  -- * Database Operations-  -- $databaseOperations--  -- ** Conversion interfaces to communicate with database-  -- $conversionInterfaces-  FromSql, ToSql,-  RecordFromSql, RecordToSql,--  -- ** Generalized Statement-  -- $generalizedStmt-  prepareNoFetch,-  bind,-  execute,-  executeNoFetch,--  -- ** Select-  -- $select-  prepareQuery,-  fetch,-  runQuery,-  runQuery',--  -- ** Insert Values-  -- $insertValue-  prepareInsert,-  runInsert,--  -- ** Insert Select Results-  -- $insertSelect-  prepareInsertQuery,-  runInsertQuery,--  -- ** Update-  -- $update-  prepareUpdate,-  runUpdate,--  -- ** Delete-  -- $delete-  prepareDelete,-  runDelete,--  -- ** Update by Key-  -- $keyUpdate-  prepareKeyUpdate,-  bindKeyUpdate,-  runKeyUpdate,--  ) where--import Database.Relational.Query-import Database.Record (RecordFromSql, FromSql, RecordToSql, ToSql)-import Database.HDBC.Record--{- $concepts-User interface of Relational Record has main two part of modules.--[@"Database.Relational.Query"@] Relational Query Building DSL--[@"Database.Record" and "Database.HDBC.Record"@] Database Operation Actions- -}--{- $queryBuildingDSL-Relational Query ("Database.Relational.Query") module-defines Typed DSL to build complex SQL query.- -}--{- $monadicContext-On building query, query structures can be accumulated in monadic context.- -}--{- $monadicOperator-Some operators are defined to build query structures in monadic context.--'query' and 'queryMaybe' operators grow query product of monadic context like join operation of SQL.-'on' operator appends a new condition into recent join product condition.--'groupBy' operator aggregates flat projection value, and can be used only in 'MonadAggregate' context.--'wheres' and 'having' operators appends a new condition into whole query condition.-'having' only accepts aggregated projection value, and can be used only in 'MonadRestrict' 'Aggregated' context.--'distinct' operator and 'all'' operator specify SELECT DISTINCT or SELECT ALL, the last specified in monad is used.--'<-#' operator assigns update target column and projection value to build update statement structure.- -}--{- $directJoin-Not monadic style join is supported by some direct join operators.--'inner', 'left', 'right', 'full' operators can construct join products directly like SQL.-'inner' operator is INNER JOIN of SQL, 'left' operator is LEFT OUTER JOIN of SQL, and so on.-'on'' operator specifies condition of join product.-'JoinRestriction' is the type of lambda form which expresses condition of join product.- -}--{- $finalize-Several operators are defined to make 'Relation' type with finalizing query monadic context.--'relation' operator finalizes flat (not aggregated) query monadic context,-and 'aggregateRelation' operator finalizes aggregated query monadic context.-Both operator convert monadic context into 'Relation' type,-and finalized 'Relation' can be reused as joining and sub-querying in another queries.--'updateTarget' operator finalize monadic context into 'UpdateTarget' type-which can be used as update statement.--'restriction' operator finalize monadic context into 'Restriction' type-which can be used as delete statement.- -}--{- $projection-SQL expression can be projected to Haskell phantom type in this DSL.- -}--{- $projectionType-'Projection' /c/ /t/ is SQL value type projection to Haskell type with context type /c/ correspond Haskell type /t/.--'Flat' is not aggregated query context type,-'Aggregated' is aggregated query context type,-'OverWindow' is window function context type, and so on.--Module "Database.Relational.Query.Context" contains documentation of other context types.- -}--{- $projectionPath-'!' operator is projected value selector using projection path type 'Pi' /r0/ /r1/.-'Pi' /r0/ /r1/ is projection path type selecting column type /r1/ from record type /r0/.-'<.>' operator makes composed projection path from two projection paths.- -}--{- $projectionOperators-Some operators are defined to calculate projected values.--For example,-'value' operator projects from Haskell value into 'Projection' corresponding SQL row value,-which projection is implicitly specified by 'ShowConstantTermsSQL' class.-Generic programming with default signature is available to define instances of 'ShowConstantTermsSQL'.--'values' operator projects from Haskell list value into 'ListProjection', corresponding SQL set value,-'.=.' operator is equal compare operation of projected value correspond to SQL =,-'.+.' operator is plus operation of projected value correspond to SQL +, and so on.--Module "Database.Relational.Query.Projectable" contains documentation of other projection operators.- -}--{- $aggregateFunctions-Typed aggregate function operators are defined.-Aggregated value types is distinguished with Flat value types.--For example,-'sum'' operator is aggregate function of projected flat (not aggregated) value-correspond to SQL SUM(...),-'rank' operator is window function of projected value correspond to SQL RANK(), and so on.--To convert window function result into normal projection, use the 'over' operator with built 'Window' monad.--Module "Database.Relational.Query.Projectable" contains documentation of-other aggregate function operators and window function operators.- -}--{- $setOperators-Several operators are defined to manipulate relation set.--'union' operator makes union relation set of two relation set correspond to SQL UNION.-'except' operator makes difference relation set of two relation set correspond to SQL EXCEPT.-'intersect' operator makes intersection relation set of two relation set correspond to SQL INTERSECT.--}--{- $maybeProjection-Some operators are provided to manage projections with 'Maybe' phantom type.--'just' operator creates 'Maybe' typed projection,-'flattenMaybe' operator joins nested 'Maybe' typed projection.--'Maybe' type flavor of operators against projection path, projection and aggregation are also provided.--For example,-'?!' operator is maybe flavor of '!',-'<?.>' operator is maybe flavor of '<.>'.-'?!?' operator and '<?.?>' operator 'join' two 'Maybe' phantom functors.--'?+?' operator is maybe flavor of '.+.',-'negateMaybe' operator is maybe flavor of 'negate'',-'sumMaybe' operator is maybe flavor of 'sum''.--Module "Database.Relational.Query.Projectable" and "Database.Relational.Query.ProjectableExtended"-contain documentation of other 'Maybe' flavor projection operators.- -}--{- $placeholders-'placeholders' operator takes-a lambda-form which argument is 'Projection' typed placeholders and its scope is restricted by that lambda-form-and then creates dummy value with 'Placeholders' typed which propagate placeholder type information into 'Relation' layer.--Placeholders' flavor of operators against query operation and set operation are also provided, to realize type safe placeholders.--'query'', 'left'', 'relation'', 'updateTarget'', 'restriction'', and 'union''-operator are placeholders' flavor 'query', 'left', 'relation', 'updateTarget', 'restriction' and 'union'.--Module "Database.Relational.Query.Relation" and "Database.Relational.Query.Effect"-contains documentation of other placeholders' flavor operators.--}--{- $recordMapping-Applicative style record mapping is supported, for 'Projection', 'Pi' and 'PlaceHolders'.-'|$|' operator can be used on 'ProjectableFunctor' context, and-'|*|' operator can be used on 'ProjectableApplicative' context with 'ProductConstructor',-like /Foo |$| projection1 |*| projection2 |*| projection3/-, /Foo |$| placeholders1 |*| placeholders2 |*| placeholders3/, and so on.--'><' operator constructs pair result. /x >< y/ is the same as /(,) |$| x |*| y/.- -}--{- $databaseStatements-Some functions are defined to expand query structure-into flat SQL statements to be used by database operation.--'relationalQuery' function converts 'Relation' type info flat SQL query like SELECT statement.--'typedInsert' function converts 'Pi' key type info flat SQL INSERT statement.--'typedInsertQuery' function converts 'Pi' key type and 'Relation' type info flat SQL INSERT ... SELECT ... statement.--'typedUpdate' function converts 'UpdateTarget' type into flat SQL UPDATE statement.--'typedDelete' function converts 'Restriction' into flat SQL DELETE statement.--'typedKeyUpdate' function converts 'Pi' key type info flat SQL UPDATE statement.--Some handy table type inferred functions are provided,-'derivedInsert', 'derivedInsertQuery', 'derivedUpdate' and 'derivedDelete'.- -}---{- $databaseOperations-Some HDBC actions are defined for database side effects.- -}--{- $conversionInterfaces-Some record conversion interfaces are defined to communicate with database.--The conversions are implicitly specified by 'FromSql' class and 'ToSql' class.-Generic programming with default signature is available to define instances of 'FromSql' and 'ToSql'.--The explicit definitions correnponsing those classes are 'RecordFromSql' and 'RecordToSql'.---}--{- $generalizedStmt-Actions to manage generalized SQL statements.- -}--{- $select-Actions to manage SELECT statements.--'runQuery' function is lazy-read and 'runQuery'' function is strict version,-please use carefully.- -}--{- $insertValue-Actions to manage INSERT ... VALUES ... statements.- -}--{- $insertSelect-Actions to manage INSERT ... SELECT ... statements.- -}--{- $update-Actions to manage UPDATE statements.- -}--{- $delete-Actions to manage DELETE statements.- -}--{- $keyUpdate-Actions to manage UPDATE statements which updates columns other than specified key of the records selected by specified key.- -}