yesod-persistent 1.1.0 → 1.1.0.1
raw patch · 2 files changed
+26/−3 lines, 2 filesdep ~persistentdep ~persistent-template
Dependency ranges changed: persistent, persistent-template
Files
- Yesod/Persist.hs +23/−0
- yesod-persistent.cabal +3/−3
Yesod/Persist.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} module Yesod.Persist ( YesodPersist (..) , YesodDB@@ -22,6 +23,16 @@ runDB :: YesodDB sub master a -> GHandler sub master a -- | Get the given entity by ID, or return a 404 not found if it doesn't exist.+#if MIN_VERSION_persistent(1, 1, 0)+get404 :: ( PersistStore (t m)+ , PersistEntity val+ , Monad (t m)+ , m ~ GHandler sub master+ , MonadTrans t+ , PersistMonadBackend (t m) ~ PersistEntityBackend val+ )+ => Key val -> t m val+#else get404 :: ( PersistStore b m , PersistEntity val , Monad (b m)@@ -29,6 +40,7 @@ , MonadTrans b ) => Key b val -> b m val+#endif get404 key = do mres <- get key case mres of@@ -37,6 +49,16 @@ -- | Get the given entity by unique key, or return a 404 not found if it doesn't -- exist.+#if MIN_VERSION_persistent(1, 1, 0)+getBy404 :: ( PersistUnique (t m)+ , PersistEntity val+ , m ~ GHandler sub master+ , Monad (t m)+ , MonadTrans t+ , PersistEntityBackend val ~ PersistMonadBackend (t m)+ )+ => Unique val -> t m (Entity val)+#else getBy404 :: ( PersistUnique b m , PersistEntity val , m ~ GHandler sub master@@ -45,6 +67,7 @@ , PersistEntityBackend val ~ b ) => Unique val b -> b m (Entity val)+#endif getBy404 key = do mres <- getBy key case mres of
yesod-persistent.cabal view
@@ -1,5 +1,5 @@ name: yesod-persistent-version: 1.1.0+version: 1.1.0.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -15,8 +15,8 @@ library build-depends: base >= 4 && < 5 , yesod-core >= 1.1 && < 1.2- , persistent >= 1.0 && < 1.1- , persistent-template >= 1.0 && < 1.1+ , persistent >= 1.0 && < 1.2+ , persistent-template >= 1.0 && < 1.2 , transformers >= 0.2.2 && < 0.4 exposed-modules: Yesod.Persist ghc-options: -Wall