relational-query: rename. adjust to update-case.

This commit is contained in:
Kei Hibino 2018-06-21 15:05:47 +09:00
parent 7c913905f8
commit 9abc2c9720

View File

@ -14,8 +14,8 @@ module Database.Relational.Derives (
-- * Query derivation -- * Query derivation
specifiedKey, specifiedKey,
selectUnique, uniqueSelect,
selectPrimary, primarySelect,
-- * Update derivation -- * Update derivation
updateByConstraintKey, updateByConstraintKey,
@ -62,21 +62,21 @@ specifiedKey key rel = relation' $ do
return (param, q) return (param, q)
-- | Query restricted with specified unique key. -- | Query restricted with specified unique key.
selectUnique :: PersistableWidth p uniqueSelect :: PersistableWidth p
=> Key Unique a p -- ^ Unique key proof object which record type is 'a' and key type is 'p'. => Key Unique a p -- ^ Unique key proof object which record type is 'a' and key type is 'p'.
-> Relation () a -- ^ 'Relation' to add restriction. -> Relation () a -- ^ 'Relation' to add restriction.
-> Relation p a -- ^ Result restricted 'Relation' -> Relation p a -- ^ Result restricted 'Relation'
selectUnique = specifiedKey . projectionKey uniqueSelect = specifiedKey . projectionKey
{-# DEPRECATED unique "use `selectUnique` instead of this." #-} {-# DEPRECATED unique "use `uniqueSelect` instead of this." #-}
-- | Deprecated. -- | Deprecated.
unique :: PersistableWidth p unique :: PersistableWidth p
=> Key Unique a p => Key Unique a p
-> Relation () a -> Relation () a
-> Relation p a -> Relation p a
unique = selectUnique unique = uniqueSelect
{-# DEPRECATED primary' "use `selectPrimary` instead of this." #-} {-# DEPRECATED primary' "use `primarySelect` instead of this." #-}
-- | Deprecated. -- | Deprecated.
primary' :: PersistableWidth p primary' :: PersistableWidth p
=> Key Primary a p -- ^ Primary key proof object which record type is 'a' and key type is 'p'. => Key Primary a p -- ^ Primary key proof object which record type is 'a' and key type is 'p'.
@ -85,17 +85,17 @@ primary' :: PersistableWidth p
primary' = specifiedKey . projectionKey primary' = specifiedKey . projectionKey
-- | Query restricted with inferred primary key. -- | Query restricted with inferred primary key.
selectPrimary :: HasConstraintKey Primary a p primarySelect :: HasConstraintKey Primary a p
=> Relation () a -- ^ 'Relation' to add restriction. => Relation () a -- ^ 'Relation' to add restriction.
-> Relation p a -- ^ Result restricted 'Relation' -> Relation p a -- ^ Result restricted 'Relation'
selectPrimary = primary' constraintKey primarySelect = primary' constraintKey
{-# DEPRECATED primary "use `selectPrimary` instead of this." #-} {-# DEPRECATED primary "use `primarySelect` instead of this." #-}
-- | Deprecated. -- | Deprecated.
primary :: HasConstraintKey Primary a p primary :: HasConstraintKey Primary a p
=> Relation () a => Relation () a
-> Relation p a -> Relation p a
primary = selectPrimary primary = primarySelect
-- | Convert from Haskell type `r` into SQL value `q` list expected by update form like -- | Convert from Haskell type `r` into SQL value `q` list expected by update form like
-- --