Final touchs on docs.
This commit is contained in:
parent
4b776dd7b6
commit
66e67e1cff
@ -322,32 +322,35 @@ import qualified Database.Persist
|
|||||||
-- from $ \\p -> do
|
-- from $ \\p -> do
|
||||||
-- where_ (p ^. PersonAge <. just (val 14))
|
-- where_ (p ^. PersonAge <. just (val 14))
|
||||||
-- @
|
-- @
|
||||||
--
|
--
|
||||||
-- The results of queries can also be used for insertions.
|
-- The results of queries can also be used for insertions.
|
||||||
-- In @SQL@, we might write the following, inserting a new blog
|
-- In @SQL@, we might write the following, inserting a new blog
|
||||||
-- post for every user:
|
-- post for every user:
|
||||||
--
|
--
|
||||||
-- @
|
-- @
|
||||||
-- INSERT INTO BlogPost
|
-- INSERT INTO BlogPost
|
||||||
-- SELECT ('Group Blog Post', id)
|
-- SELECT ('Group Blog Post', id)
|
||||||
-- FROM Person
|
-- FROM Person
|
||||||
-- @
|
-- @
|
||||||
--
|
--
|
||||||
-- In @esqueleto@, we may write the same query above as:
|
-- In @esqueleto@, we may write the same query above as:
|
||||||
--
|
--
|
||||||
-- @
|
-- @
|
||||||
-- insertSelect $ from $ \p->
|
-- insertSelect $ from $ \p->
|
||||||
-- return $ BlogPost \<# \"Group Blog Post\" \<&\> (p ^. PersonId)
|
-- return $ BlogPost \<# \"Group Blog Post\" \<&\> (p ^. PersonId)
|
||||||
-- @
|
-- @
|
||||||
--
|
--
|
||||||
-- Individual insertions can be performed through Persistent's
|
-- Individual insertions can be performed through Persistent's
|
||||||
-- 'insert' function, reexported for convenience.
|
-- 'insert' function, reexported for convenience.
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
-- $reexports
|
-- $reexports
|
||||||
--
|
--
|
||||||
-- We re-export many symbols from @persistent@ for convenince
|
-- We re-export many symbols from @persistent@ for convenince:
|
||||||
|
--
|
||||||
-- * \"Store functions\" from "Database.Persist".
|
-- * \"Store functions\" from "Database.Persist".
|
||||||
--
|
--
|
||||||
-- * Everything from "Database.Persist.Class" except for
|
-- * Everything from "Database.Persist.Class" except for
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user