Merge branch 'master' of git://github.com/meteficha/esqueleto
This commit is contained in:
commit
024537b592
@ -1,5 +1,5 @@
|
|||||||
name: esqueleto
|
name: esqueleto
|
||||||
version: 1.2.2
|
version: 1.2.3
|
||||||
synopsis: Bare bones, type-safe EDSL for SQL queries on persistent backends.
|
synopsis: Bare bones, type-safe EDSL for SQL queries on persistent backends.
|
||||||
homepage: https://github.com/meteficha/esqueleto
|
homepage: https://github.com/meteficha/esqueleto
|
||||||
license: BSD3
|
license: BSD3
|
||||||
@ -81,7 +81,7 @@ test-suite test
|
|||||||
-- Test-only dependencies
|
-- Test-only dependencies
|
||||||
, HUnit
|
, HUnit
|
||||||
, QuickCheck
|
, QuickCheck
|
||||||
, hspec >= 1.3 && < 1.6
|
, hspec >= 1.3 && < 1.7
|
||||||
, persistent-sqlite == 1.2.*
|
, persistent-sqlite == 1.2.*
|
||||||
, persistent-template == 1.2.*
|
, persistent-template == 1.2.*
|
||||||
, monad-control
|
, monad-control
|
||||||
|
|||||||
@ -323,32 +323,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