yesod-persistent 1.6.0.6 → 1.6.0.7
raw patch · 3 files changed
+14/−2 lines, 3 files
Files
- ChangeLog.md +4/−0
- Yesod/Persist/Core.hs +9/−1
- yesod-persistent.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for yesod-persistent +## 1.6.0.7++* Add support for persistent 2.13. [#1723](https://github.com/yesodweb/yesod/pull/1723)+ ## 1.6.0.6 * Add support for persistent 2.12
Yesod/Persist/Core.hs view
@@ -25,6 +25,7 @@ import Database.Persist import Control.Monad.Trans.Reader (ReaderT, runReaderT) +import Data.Foldable (toList) import Yesod.Core import Data.Conduit import Blaze.ByteString.Builder (Builder)@@ -33,6 +34,9 @@ import Control.Exception (throwIO) import Yesod.Core.Types (HandlerContents (HCError)) import qualified Database.Persist.Sql as SQL+#if MIN_VERSION_persistent(2,13,0)+import qualified Database.Persist.SqlBackend.Internal as SQL+#endif unSqlPersistT :: a -> a unSqlPersistT = id@@ -197,7 +201,11 @@ case conflict of Just unique -> #if MIN_VERSION_persistent(2, 12, 0)- badRequest' $ map (unFieldNameHS . fst) $ persistUniqueToFieldNames unique+-- toList is called here because persistent-2.13 changed this+-- to a nonempty list. for versions of persistent prior to 2.13, toList+-- will be a no-op. for persistent-2.13, it'll convert the NonEmptyList to+-- a List.+ badRequest' $ map (unFieldNameHS . fst) $ toList $ persistUniqueToFieldNames unique #else badRequest' $ map (unHaskellName . fst) $ persistUniqueToFieldNames unique #endif
yesod-persistent.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: yesod-persistent-version: 1.6.0.6+version: 1.6.0.7 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>