snaplet-persistent 0.5.1 → 0.6.0
raw patch · 4 files changed
+19/−9 lines, 4 filesdep ~persistentdep ~persistent-postgresqldep ~resourcet
Dependency ranges changed: persistent, persistent-postgresql, resourcet, snap, time
Files
- CHANGELOG.md +4/−0
- snaplet-persistent.cabal +6/−6
- src/Snap/Snaplet/Auth/Backends/Persistent.hs +6/−0
- src/Snap/Snaplet/Persistent.hs +3/−3
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.6.0+* Switch the transformer order to align with persistent's SqlPersistM.+* Allow for newer versions of snap and other dependencies.+ # 0.5.1 * Allow for newer dependencies.
snaplet-persistent.cabal view
@@ -1,5 +1,5 @@ name: snaplet-persistent-version: 0.5.1+version: 0.6.0 synopsis: persistent snaplet for the Snap Framework description: Snaplet support for using the Postgresql database with a Snap Framework application via the persistent@@ -50,16 +50,16 @@ errors >= 1.4 && < 2.3, monad-logger >= 0.2.4 && < 0.4, mtl >= 2 && < 3,- persistent >= 2.0 && < 2.8,- persistent-postgresql >= 2.0 && < 2.7,+ persistent >= 2.0 && < 2.9,+ persistent-postgresql >= 2.0 && < 2.9, persistent-template >= 2.0 && < 2.6, readable >= 0.1 && < 0.4, resource-pool >= 0.2 && < 0.3,- resourcet >= 0.4 && < 1.2,+ resourcet >= 0.4 && < 1.3, safe >= 0.3 && < 0.4,- snap >= 0.13 && < 1.1,+ snap >= 0.13 && < 1.2, text >= 0.11 && < 1.3,- time >= 1.1 && < 1.7,+ time >= 1.1 && < 1.9, transformers >= 0.2 && < 0.6, unordered-containers >= 0.2 && < 0.3, map-syntax
src/Snap/Snaplet/Auth/Backends/Persistent.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE CPP #-} module Snap.Snaplet.Auth.Backends.Persistent@@ -256,3 +257,8 @@ res <- selectFirst [SnapAuthUserRememberToken ==. Just token] [] return $ fmap db2au res +#if MIN_VERSION_snap(1,1,0)+ lookupByEmail PAM{..} email = withPool pamPool $ do+ res <- selectFirst [SnapAuthUserEmail ==. email] []+ return $ fmap db2au res+#endif
src/Snap/Snaplet/Persistent.hs view
@@ -133,7 +133,7 @@ ------------------------------------------------------------------------------- -- | Runs a SqlPersist action in any monad with a HasPersistPool instance. runPersist :: (HasPersistPool m)- => SqlPersistT (ResourceT (NoLoggingT IO)) b+ => SqlPersistM b -- ^ Run given Persistent action in the defined monad. -> m b runPersist action = do@@ -145,8 +145,8 @@ -- | Run a database action withPool :: MonadIO m => ConnectionPool- -> SqlPersistT (ResourceT (NoLoggingT IO)) a -> m a-withPool cp f = liftIO . runNoLoggingT . runResourceT $ runSqlPool f cp+ -> SqlPersistM a -> m a+withPool cp f = liftIO . runResourceT . runNoLoggingT $ runSqlPool f cp -------------------------------------------------------------------------------