Update haddocks.

This commit is contained in:
Kei Hibino 2013-08-15 17:53:29 +09:00
parent cd4dd0a83a
commit e184e5a1d8
5 changed files with 7 additions and 0 deletions

View File

@ -30,5 +30,6 @@ type Restrict = Trans.Restrict Identity
-- restricted :: a -> Restrict a
-- restricted = restrict . Identity
-- | Run 'Restrict' to get SQL WHERE clause.
expandPrepend :: Restrict a -> (a, WherePrepend)
expandPrepend = runIdentity . extractWheres

View File

@ -25,6 +25,7 @@ import Database.Relational.Query.Projectable (PlaceHolders)
import Database.Relational.Query.Monad.Trans.Restrict (prependWhere)
import Database.Relational.Query.Monad.Restrict (Restrict, expandPrepend)
-- | Restriction type with place-holder parameter 'p' and projection record type 'r'.
newtype Restriction p r = Restriction (Projection r -> Restrict ())
-- | Finalize 'Restrict' monad and generate 'Restriction'.

View File

@ -97,9 +97,11 @@ insertSQL :: Table r -- ^ Table metadata
-> String -- ^ Result SQL
insertSQL tbl = insertSQL' (name tbl) (columns tbl)
-- | Generate all column delete SQL by specified table. Untyped table version.
deleteSQL' :: String -> ShowS
deleteSQL' table = (SQL.unwordsSQL [DELETE, FROM, SQL.word table] ++)
-- | Generate all column delete SQL by specified table.
deleteSQL :: Table r -- ^ Table metadata
-> ShowS -- ^ Result SQL
deleteSQL = deleteSQL' . name

View File

@ -72,6 +72,7 @@ typedUpdate tbl = unsafeTypedUpdate . updateSQL tbl
instance Show (Update p a) where
show = untypeUpdate
-- | Make typed 'Update' from 'Table' and 'Restriction'.
restrictedUpdate :: Table r -> Restriction p r -> Update p r
restrictedUpdate tbl r = unsafeTypedUpdate . updateAllColumnsSQL tbl
. sqlWhereFromRestriction tbl r $ ""
@ -104,6 +105,7 @@ unsafeTypedDelete = Delete
instance Show (Delete p a) where
show = untypeDelete
-- | Make typed 'Delete' from 'Table' and 'Restriction'.
restrictedDelete :: Table r -> Restriction p r -> Delete p a
restrictedDelete tbl r = unsafeTypedDelete . deleteSQL tbl
. sqlWhereFromRestriction tbl r $ ""

View File

@ -24,6 +24,7 @@ library
Database.HDBC.Record.Persistable
Database.HDBC.Record.Singleton
Database.HDBC.Record.TH
Database.HDBC.Record.Statement
Database.HDBC.Record.Query
Database.HDBC.Query.TH
Database.HDBC.SqlValueExtra