Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-persistent for openSUSE:Factory 
checked in at 2021-11-11 21:36:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-persistent (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-persistent.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-persistent"

Thu Nov 11 21:36:45 2021 rev:32 rq:930347 version:2.13.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-persistent/ghc-persistent.changes    
2021-09-10 23:41:27.070568317 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-persistent.new.1890/ghc-persistent.changes  
2021-11-11 21:37:03.896916786 +0100
@@ -1,0 +2,35 @@
+Tue Oct 19 07:23:41 UTC 2021 - [email protected]
+
+- Update persistent to version 2.13.2.1 revision 1.
+  Upstream has revised the Cabal build instructions on Hackage.
+
+-------------------------------------------------------------------
+Thu Oct 14 08:01:08 UTC 2021 - [email protected]
+
+- Update persistent to version 2.13.2.1.
+  ## 2.13.2.1
+
+  * [#1329](https://github.com/yesodweb/persistent/pull/1329)
+      * Prevent discovery of constrained `PersistEntity` instances in
+        `discoverEntities` (since the discovered instances won't work without
+        constraints anyway).
+
+  ## 2.13.2.0
+
+  * [#1314](https://github.com/yesodweb/persistent/pull/1314)
+      * Fix typos and minor documentation issues in Database.Persist and
+        Database.Persist.Quasi.
+  * [#1317](https://github.com/yesodweb/persistent/pull/1317)
+      * Expose `orderClause` from the Persistent internals, which allows users
+        to produce well-formatted `ORDER BY` clauses.
+
+  * [#1319](https://github.com/yesodweb/persistent/pull/1319)
+      * Add a `Num` instance for `OverflowNatural`
+
+-------------------------------------------------------------------
+Tue Oct 12 09:50:03 UTC 2021 - [email protected]
+
+- Update persistent to version 2.13.1.2 revision 1.
+  Upstream has revised the Cabal build instructions on Hackage.
+
+-------------------------------------------------------------------

Old:
----
  persistent-2.13.1.2.tar.gz

New:
----
  persistent-2.13.2.1.tar.gz
  persistent.cabal

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-persistent.spec ++++++
--- /var/tmp/diff_new_pack.bEbWDC/_old  2021-11-11 21:37:05.076917647 +0100
+++ /var/tmp/diff_new_pack.bEbWDC/_new  2021-11-11 21:37:05.080917649 +0100
@@ -19,12 +19,13 @@
 %global pkg_name persistent
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        2.13.1.2
+Version:        2.13.2.1
 Release:        0
 Summary:        Type-safe, multi-backend data serialization
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
@@ -77,6 +78,7 @@
 
 %prep
 %autosetup -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ persistent-2.13.1.2.tar.gz -> persistent-2.13.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/ChangeLog.md 
new/persistent-2.13.2.1/ChangeLog.md
--- old/persistent-2.13.1.2/ChangeLog.md        2021-09-01 23:59:49.000000000 
+0200
+++ new/persistent-2.13.2.1/ChangeLog.md        2021-10-13 21:16:31.000000000 
+0200
@@ -1,5 +1,24 @@
 # Changelog for persistent
 
+## 2.13.2.1
+
+* [#1329](https://github.com/yesodweb/persistent/pull/1329)
+    * Prevent discovery of constrained `PersistEntity` instances in
+      `discoverEntities` (since the discovered instances won't work without
+      constraints anyway).
+
+## 2.13.2.0
+
+* [#1314](https://github.com/yesodweb/persistent/pull/1314)
+    * Fix typos and minor documentation issues in Database.Persist and
+      Database.Persist.Quasi.
+* [#1317](https://github.com/yesodweb/persistent/pull/1317)
+    * Expose `orderClause` from the Persistent internals, which allows users
+      to produce well-formatted `ORDER BY` clauses.
+
+* [#1319](https://github.com/yesodweb/persistent/pull/1319)
+    * Add a `Num` instance for `OverflowNatural`
+
 ## 2.13.1.2
 
 * [#1308](https://github.com/yesodweb/persistent/pull/1308)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/persistent-2.13.1.2/Database/Persist/Class/PersistField.hs 
new/persistent-2.13.2.1/Database/Persist/Class/PersistField.hs
--- old/persistent-2.13.1.2/Database/Persist/Class/PersistField.hs      
2021-05-24 17:18:53.000000000 +0200
+++ new/persistent-2.13.2.1/Database/Persist/Class/PersistField.hs      
2021-10-08 01:46:36.000000000 +0200
@@ -2,7 +2,7 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE ExistentialQuantification #-}
 {-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE PatternGuards, DataKinds, TypeOperators, UndecidableInstances #-}
+{-# LANGUAGE PatternGuards, DataKinds, TypeOperators, UndecidableInstances, 
GeneralizedNewtypeDeriving #-}
 module Database.Persist.Class.PersistField
     ( PersistField (..)
     , SomePersistField (..)
@@ -346,7 +346,7 @@
 --
 -- @since 2.11.0
 newtype OverflowNatural = OverflowNatural { unOverflowNatural :: Natural }
-    deriving (Eq, Show, Ord)
+    deriving (Eq, Show, Ord, Num)
 
 instance
   TypeError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/Database/Persist/Quasi.hs 
new/persistent-2.13.2.1/Database/Persist/Quasi.hs
--- old/persistent-2.13.1.2/Database/Persist/Quasi.hs   2021-09-01 
18:28:44.000000000 +0200
+++ new/persistent-2.13.2.1/Database/Persist/Quasi.hs   2021-09-07 
00:58:52.000000000 +0200
@@ -203,7 +203,7 @@
 Person json
     name Text
 @
-Requires @{-# LANGUAGE FlexibleInstances #-}@
+Requires @\{\-\# LANGUAGE FlexibleInstances \#\-\}@
 
 Customizable by using mpsEntityJSON
 * 
http://hackage.haskell.org/package/persistent-template/docs/Database-Persist-TH.html#v:EntityJSON
@@ -216,7 +216,7 @@
     name Text
 @
 
-== Change table/collection key definition (field name and/or type, persistent 
>= 2.1)
+== Change table/collection key definition (field name and\/or type, persistent 
>= 2.1)
 
 @Id@ defines the column to use to define the key of the entity.
 Without type, the default backend key type will be used. You can change its
@@ -956,7 +956,7 @@
 setPsStrictFields :: Bool -> PersistSettings -> PersistSettings
 setPsStrictFields a ps = ps { psStrictFields = a }
 
--- | Retrievce the default name of the @id@ column.
+-- | Retrieve the default name of the @id@ column.
 --
 -- @since 2.13.0.0
 getPsIdName :: PersistSettings -> Text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/persistent-2.13.1.2/Database/Persist/Sql/Orphan/PersistQuery.hs 
new/persistent-2.13.2.1/Database/Persist/Sql/Orphan/PersistQuery.hs
--- old/persistent-2.13.1.2/Database/Persist/Sql/Orphan/PersistQuery.hs 
2021-05-24 17:18:53.000000000 +0200
+++ new/persistent-2.13.2.1/Database/Persist/Sql/Orphan/PersistQuery.hs 
2021-10-08 01:46:36.000000000 +0200
@@ -10,6 +10,7 @@
     , filterClause
     , filterClauseHelper
     , filterClauseWithVals
+    , orderClause
     , FilterTablePrefix (..)
     , decorateSQLWithLimitOffset
     ) where
@@ -20,13 +21,13 @@
 import Data.ByteString.Char8 (readInteger)
 import Data.Conduit
 import qualified Data.Conduit.List as CL
+import Data.Foldable (toList)
 import Data.Int (Int64)
 import Data.List (find, inits, transpose)
 import Data.Maybe (isJust)
 import Data.Monoid (Monoid(..))
 import Data.Text (Text)
 import qualified Data.Text as T
-import Data.Foldable (toList)
 
 import Database.Persist hiding (updateField)
 import Database.Persist.Sql.Orphan.PersistStore (withRawQuery)
@@ -36,8 +37,8 @@
 import Database.Persist.Sql.Util
        ( commaSeparated
        , dbIdColumns
-       , keyAndEntityColumnNames
        , isIdField
+       , keyAndEntityColumnNames
        , mkUpdateText
        , parseEntityValues
        , updatePersistValue
@@ -111,10 +112,7 @@
         wher conn = if null filts
                     then ""
                     else filterClause Nothing conn filts
-        ord conn =
-            case map (orderClause False conn) orders of
-                [] -> ""
-                ords -> " ORDER BY " <> T.intercalate "," ords
+        ord conn = orderClause Nothing conn orders
         cols = commaSeparated . toList . keyAndEntityColumnNames t
         sql conn = connLimitOffset conn (limit,offset) $ mconcat
             [ "SELECT "
@@ -148,10 +146,7 @@
 
         (limit, offset, orders) = limitOffsetOrder opts
 
-        ord conn =
-            case map (orderClause False conn) orders of
-                [] -> ""
-                ords -> " ORDER BY " <> T.intercalate "," ords
+        ord conn = orderClause Nothing conn orders
 
         parse xs = do
             keyvals <- case entityPrimary t of
@@ -262,6 +257,16 @@
     --
     -- @since 2.12.1.0
 
+prefixByTable
+    :: Maybe FilterTablePrefix
+    -> Text -- ^ Table name
+    -> (Text -> Text) -- ^ Prefixing function
+prefixByTable tablePrefix tableName =
+    case tablePrefix of
+        Just PrefixTableName -> ((tableName <> ".") <>)
+        Just PrefixExcluded -> (("EXCLUDED.") <>)
+        _ -> id
+
 filterClauseHelper
     :: (PersistEntity val)
     => Maybe FilterTablePrefix -- ^ include table name or PostgresSQL EXCLUDED
@@ -410,11 +415,7 @@
         notNullVals = filter (/= PersistNull) allVals
         allVals = filterValueToPersistValues value
         tn = connEscapeTableName conn $ entityDef $ dummyFromFilts [Filter 
field value pfilter]
-        name =
-          case tablePrefix of
-            Just PrefixTableName -> ((tn <> ".") <>) $ connEscapeFieldName 
conn (fieldName field)
-            Just PrefixExcluded -> (("EXCLUDED.") <>) $ connEscapeFieldName 
conn (fieldName field)
-            _ -> id $ connEscapeFieldName conn (fieldName field)
+        name = prefixByTable tablePrefix tn $ connEscapeFieldName conn 
(fieldName field)
         qmarks = case value of
                     FilterValue{} -> "(?)"
                     UnsafeValue{} -> "(?)"
@@ -457,28 +458,35 @@
              -> (Text, [PersistValue])
 filterClauseWithVals b c  = filterClauseHelper b True c OrNullNo
 
+-- | Render a @['SelectOpt' record]@ made up *only* of 'Asc' and 'Desc' 
constructors
+-- into a 'Text' value suitable for inclusion into a SQL query.
+--
+-- @since 2.13.2.0
 orderClause :: (PersistEntity val)
-            => Bool -- ^ include the table name
+            => Maybe FilterTablePrefix -- ^ include table name or EXCLUDED
             -> SqlBackend
-            -> SelectOpt val
+            -> [SelectOpt val]
             -> Text
-orderClause includeTable conn o =
-    case o of
-        Asc  x -> name x
-        Desc x -> name x <> " DESC"
-        _ -> error "orderClause: expected Asc or Desc, not limit or offset"
+orderClause includeTable conn orders =
+    if null orders
+        then ""
+        else
+            " ORDER BY " <> T.intercalate ","
+                (map (\case
+                    Asc  x -> name x
+                    Desc x -> name x <> " DESC"
+                    _ -> error "orderClause: expected Asc or Desc, not limit 
or offset")
+                    orders)
   where
-    dummyFromOrder :: SelectOpt a -> Maybe a
+    dummyFromOrder :: [SelectOpt a] -> Maybe a
     dummyFromOrder _ = Nothing
 
-    tn = connEscapeTableName conn (entityDef $ dummyFromOrder o)
+    tn = connEscapeTableName conn (entityDef $ dummyFromOrder orders)
 
     name :: (PersistEntity record)
          => EntityField record typ -> Text
     name x =
-        (if includeTable
-            then ((tn <> ".") <>)
-            else id)
+        prefixByTable includeTable tn
         $ connEscapeFieldName conn (fieldName x)
 
 -- | Generates sql for limit and offset for postgres, sqlite and mysql.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/Database/Persist/Sql.hs 
new/persistent-2.13.2.1/Database/Persist/Sql.hs
--- old/persistent-2.13.1.2/Database/Persist/Sql.hs     2021-09-01 
23:59:49.000000000 +0200
+++ new/persistent-2.13.2.1/Database/Persist/Sql.hs     2021-10-08 
01:46:36.000000000 +0200
@@ -38,6 +38,7 @@
     , updateWhereCount
     , filterClause
     , filterClauseWithVals
+    , orderClause
     , FilterTablePrefix (..)
     -- * Transactions
     , transactionSave
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/Database/Persist/TH.hs 
new/persistent-2.13.2.1/Database/Persist/TH.hs
--- old/persistent-2.13.1.2/Database/Persist/TH.hs      2021-08-30 
23:32:36.000000000 +0200
+++ new/persistent-2.13.2.1/Database/Persist/TH.hs      2021-10-13 
21:16:31.000000000 +0200
@@ -3104,7 +3104,7 @@
             mapMaybe getDecType instances
         getDecType dec =
             case dec of
-                InstanceD _moverlap _cxt typ _decs ->
+                InstanceD _moverlap [] typ _decs ->
                     stripPersistEntity typ
                 _ ->
                     Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/Database/Persist.hs 
new/persistent-2.13.2.1/Database/Persist.hs
--- old/persistent-2.13.1.2/Database/Persist.hs 2021-09-01 23:59:49.000000000 
+0200
+++ new/persistent-2.13.2.1/Database/Persist.hs 2021-09-07 00:58:52.000000000 
+0200
@@ -16,7 +16,7 @@
 -- This syntax allows you to customize the resulting Haskell datatypes and
 -- database schema. See "Database.Persist.Quasi" for details on that definition
 -- language.
---
+
 -- ** Reference Schema & Dataset
 --
 -- | For a quick example of the syntax, we'll introduce this database schema, 
and
@@ -31,7 +31,7 @@
 -- |]
 -- @
 --
--- This creates a Haskell datatpe that looks like this:
+-- This creates a Haskell datatype that looks like this:
 --
 -- @
 -- data User = User
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-2.13.1.2/persistent.cabal 
new/persistent-2.13.2.1/persistent.cabal
--- old/persistent-2.13.1.2/persistent.cabal    2021-09-02 00:00:41.000000000 
+0200
+++ new/persistent-2.13.2.1/persistent.cabal    2021-10-13 21:16:31.000000000 
+0200
@@ -1,5 +1,5 @@
 name:            persistent
-version:         2.13.1.2
+version:         2.13.2.1
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <[email protected]>

++++++ persistent.cabal ++++++
name:            persistent
version:         2.13.2.1
x-revision: 1
license:         MIT
license-file:    LICENSE
author:          Michael Snoyman <[email protected]>
maintainer:      Michael Snoyman <[email protected]>, Greg Weber 
<[email protected]>
synopsis:        Type-safe, multi-backend data serialization.
description:     Hackage documentation generation is not reliable. For up to 
date documentation, please see: <http://www.stackage.org/package/persistent>.
category:        Database, Yesod
stability:       Stable
cabal-version:   >= 1.10
build-type:      Simple
homepage:        http://www.yesodweb.com/book/persistent
bug-reports:     https://github.com/yesodweb/persistent/issues
extra-source-files: ChangeLog.md README.md

library
    build-depends:   
        base                     >= 4.11.1.0     && < 5
      , aeson                    >= 1.0 && < 1.6
      , attoparsec
      , base64-bytestring
      , blaze-html               >= 0.9
      , bytestring               >= 0.10
      , conduit                  >= 1.2.12
      , containers               >= 0.5
      , fast-logger              >= 2.4
      , http-api-data            >= 0.3
      , lift-type                >= 0.1.0.0 && < 0.2.0.0
      , monad-logger             >= 0.3.28
      , mtl
      , path-pieces              >= 0.2
      , resource-pool            >= 0.2.3
      , resourcet                >= 1.1.10
      , scientific
      , silently
      , template-haskell         >= 2.13 && < 2.18
      , text                     >= 1.2
      , th-lift-instances        >= 0.1.14    && < 0.2
      , time                     >= 1.6
      , transformers             >= 0.5
      , unliftio
      , unliftio-core
      , unordered-containers
      , vector

    default-extensions: 
        FlexibleContexts
      , MultiParamTypeClasses
      , OverloadedStrings
      , TypeFamilies

    exposed-modules: 
        Database.Persist
        Database.Persist.Types
        Database.Persist.Names
        Database.Persist.PersistValue
        Database.Persist.EntityDef
        Database.Persist.EntityDef.Internal
        Database.Persist.FieldDef
        Database.Persist.FieldDef.Internal
        Database.Persist.ImplicitIdDef
        Database.Persist.ImplicitIdDef.Internal
        Database.Persist.TH

        Database.Persist.Quasi
        Database.Persist.Quasi.Internal

        Database.Persist.Sql
        Database.Persist.Sql.Migration
        Database.Persist.Sql.Types.Internal
        Database.Persist.Sql.Util

        Database.Persist.SqlBackend
        Database.Persist.SqlBackend.Internal
        Database.Persist.SqlBackend.Internal.InsertSqlResult
        Database.Persist.SqlBackend.Internal.IsolationLevel
        Database.Persist.SqlBackend.Internal.Statement
        Database.Persist.SqlBackend.Internal.MkSqlBackend

        Database.Persist.Class
        Database.Persist.Class.DeleteCascade
        Database.Persist.Class.PersistEntity
        Database.Persist.Class.PersistQuery
        Database.Persist.Class.PersistUnique
        Database.Persist.Class.PersistConfig
        Database.Persist.Class.PersistField
        Database.Persist.Class.PersistStore

    other-modules:   
        Database.Persist.Types.Base

        Database.Persist.Sql.Internal
        Database.Persist.Sql.Types
        Database.Persist.Sql.Raw
        Database.Persist.Sql.Run
        Database.Persist.Sql.Class
        Database.Persist.Sql.Orphan.PersistQuery
        Database.Persist.Sql.Orphan.PersistStore
        Database.Persist.Sql.Orphan.PersistUnique

    -- These modules only make sense for compilers with access to DerivingVia
    if impl(ghc >= 8.6.1)
        exposed-modules: 
            Database.Persist.Compatible
        other-modules: 
            Database.Persist.Compatible.Types
            Database.Persist.Compatible.TH

    ghc-options:     -Wall
    default-language: Haskell2010

test-suite test
    type:          exitcode-stdio-1.0
    main-is:       main.hs

    build-depends:   
        base >= 4.9 && < 5
      , aeson
      , attoparsec
      , base64-bytestring
      , blaze-html
      , bytestring
      , conduit
      , containers
      , fast-logger
      , hspec         >= 2.4
      , http-api-data
      , monad-logger
      , mtl
      , path-pieces
      , persistent
      , QuickCheck
      , quickcheck-instances     >= 0.3
      , resource-pool
      , resourcet
      , scientific
      , shakespeare
      , silently
      , template-haskell         >= 2.4
      , text
      , th-lift-instances
      , time
      , transformers
      , unliftio
      , unliftio-core
      , unordered-containers
      , vector

    hs-source-dirs:
        test/

    ghc-options: -Wall

    default-extensions: FlexibleContexts
                      , MultiParamTypeClasses
                      , OverloadedStrings
                      , TypeFamilies

    other-modules:   
        Database.Persist.ClassSpec
        Database.Persist.PersistValueSpec
        Database.Persist.QuasiSpec
        Database.Persist.TH.DiscoverEntitiesSpec
        Database.Persist.TH.EmbedSpec
        Database.Persist.TH.ForeignRefSpec
        Database.Persist.TH.PersistWith.Model
        Database.Persist.TH.PersistWith.Model2
        Database.Persist.TH.PersistWithSpec
        Database.Persist.TH.CommentSpec
        Database.Persist.TH.ImplicitIdColSpec
        Database.Persist.TH.JsonEncodingSpec
        Database.Persist.TH.KindEntitiesSpec
        Database.Persist.TH.KindEntitiesSpecImports
        Database.Persist.TH.MigrationOnlySpec
        Database.Persist.TH.MaybeFieldDefsSpec
        Database.Persist.TH.MultiBlockSpec
        Database.Persist.TH.MultiBlockSpec.Model
        Database.Persist.TH.OverloadedLabelSpec
        Database.Persist.TH.SharedPrimaryKeyImportedSpec
        Database.Persist.TH.SharedPrimaryKeySpec
        Database.Persist.THSpec
        Database.Persist.TH.ToFromPersistValuesSpec
        TemplateTestImports
    default-language: Haskell2010

source-repository head
  type:     git
  location: git://github.com/yesodweb/persistent.git

benchmark persistent-th-bench
    ghc-options:      -O2
    type:             exitcode-stdio-1.0
    main-is:          Main.hs
    hs-source-dirs:   bench
    build-depends:    base
                    , persistent
                    , criterion
                    , deepseq >= 1.4
                    , file-embed
                    , text
                    , template-haskell
    other-modules:    Models
    default-language: Haskell2010

Reply via email to