commit ghc-persistent-mysql for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-persistent-mysql for openSUSE:Factory checked in at 2017-09-15 22:04:11 Comparing /work/SRC/openSUSE:Factory/ghc-persistent-mysql (Old) and /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new (New) Package is "ghc-persistent-mysql" Fri Sep 15 22:04:11 2017 rev:5 rq:525149 version:2.6.1 Changes: --- /work/SRC/openSUSE:Factory/ghc-persistent-mysql/ghc-persistent-mysql.changes 2017-07-06 00:03:33.744922112 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new/ghc-persistent-mysql.changes 2017-09-15 22:04:12.284585588 +0200 @@ -1,0 +2,5 @@ +Thu Aug 3 15:38:38 UTC 2017 - psim...@suse.com + +- Updated with latest spec-cleaner version 0.9.8-8-geadfbbf. + +--- Other differences: -- ++ ghc-persistent-mysql.spec ++ --- /var/tmp/diff_new_pack.IrvjTM/_old 2017-09-15 22:04:12.864503877 +0200 +++ /var/tmp/diff_new_pack.IrvjTM/_new 2017-09-15 22:04:12.864503877 +0200 @@ -22,8 +22,8 @@ Release:0 Summary:Backend for the persistent library using MySQL database server License:MIT -Group: Development/Languages/Other -Url:https://hackage.haskell.org/package/%{pkg_name} +Group: Development/Libraries/Haskell +URL:https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel @@ -41,7 +41,6 @@ BuildRequires: ghc-rpm-macros BuildRequires: ghc-text-devel BuildRequires: ghc-transformers-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package contains a backend for persistent using the MySQL database server. @@ -57,7 +56,7 @@ %package devel Summary:Haskell %{pkg_name} library development files -Group: Development/Libraries/Other +Group: Development/Libraries/Haskell Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} @@ -83,11 +82,9 @@ %ghc_pkg_recache %files -f %{name}.files -%defattr(-,root,root,-) %doc LICENSE %files devel -f %{name}-devel.files -%defattr(-,root,root,-) %doc ChangeLog.md %changelog
commit ghc-persistent-mysql for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-persistent-mysql for openSUSE:Factory checked in at 2017-07-06 00:03:32 Comparing /work/SRC/openSUSE:Factory/ghc-persistent-mysql (Old) and /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new (New) Package is "ghc-persistent-mysql" Thu Jul 6 00:03:32 2017 rev:4 rq:508035 version:2.6.1 Changes: --- /work/SRC/openSUSE:Factory/ghc-persistent-mysql/ghc-persistent-mysql.changes 2017-06-04 01:58:20.224846862 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new/ghc-persistent-mysql.changes 2017-07-06 00:03:33.744922112 +0200 @@ -1,0 +2,5 @@ +Sun Jun 25 18:41:41 UTC 2017 - psim...@suse.com + +- Update to version 2.6.1. + +--- Old: persistent-mysql-2.6.0.2.tar.gz New: persistent-mysql-2.6.1.tar.gz Other differences: -- ++ ghc-persistent-mysql.spec ++ --- /var/tmp/diff_new_pack.ZpUu7o/_old 2017-07-06 00:03:34.564806609 +0200 +++ /var/tmp/diff_new_pack.ZpUu7o/_new 2017-07-06 00:03:34.564806609 +0200 @@ -18,7 +18,7 @@ %global pkg_name persistent-mysql Name: ghc-%{pkg_name} -Version:2.6.0.2 +Version:2.6.1 Release:0 Summary:Backend for the persistent library using MySQL database server License:MIT ++ persistent-mysql-2.6.0.2.tar.gz -> persistent-mysql-2.6.1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/persistent-mysql-2.6.0.2/ChangeLog.md new/persistent-mysql-2.6.1/ChangeLog.md --- old/persistent-mysql-2.6.0.2/ChangeLog.md 2017-05-16 20:03:39.0 +0200 +++ new/persistent-mysql-2.6.1/ChangeLog.md 2017-06-19 06:27:00.0 +0200 @@ -1,4 +1,8 @@ -##2.6.0.2 +## 2.6.1 + +* Add functions `insertOnDuplicateKeyUpdate`, `insertManyOnDuplicateKeyUpdate` to `Database.Persist.MySQL` module. + +## 2.6.0.2 Prevent spurious no-op migrations when `default=NULL` is specified - revised version [#672](https://github.com/yesodweb/persistent/pull/672) (which fixes bug [#671](https://github.com/yesodweb/persistent/issues/671) introduced by the earlier attempt [#641](https://github.com/yesodweb/persistent/pull/641)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/persistent-mysql-2.6.0.2/Database/Persist/MySQL.hs new/persistent-mysql-2.6.1/Database/Persist/MySQL.hs --- old/persistent-mysql-2.6.0.2/Database/Persist/MySQL.hs 2017-05-16 20:03:39.0 +0200 +++ new/persistent-mysql-2.6.1/Database/Persist/MySQL.hs2017-06-19 06:27:00.0 +0200 @@ -1,4 +1,5 @@ {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} @@ -14,6 +15,9 @@ , MySQLBase.defaultSSLInfo , MySQLConf(..) , mockMigration +, insertOnDuplicateKeyUpdate +, insertManyOnDuplicateKeyUpdate +, SomeField(..) ) where import Control.Arrow @@ -1014,3 +1018,107 @@ result = runReaderT . runWriterT . runWriterT $ mig resp <- result sqlbackend mapM_ T.putStrLn $ map snd $ snd resp + +-- | MySQL specific 'upsert'. This will prevent multiple queries, when one will +-- do. +insertOnDuplicateKeyUpdate + :: ( PersistEntityBackend record ~ BaseBackend backend + , PersistEntity record + , MonadIO m + , PersistStore backend + , backend ~ SqlBackend + ) + => record + -> [Update record] + -> SqlPersistT m () +insertOnDuplicateKeyUpdate record = + insertManyOnDuplicateKeyUpdate [record] [] + +-- | This wraps values of an Entity's 'EntityField', making them have the same +-- type. This allows them to be put in lists. +data SomeField record where + SomeField :: EntityField record typ -> SomeField record + +-- | Do a bulk insert on the given records in the first parameter. In the event +-- that a key conflicts with a record currently in the database, the second and +-- third parameters determine what will happen. +-- +-- The second parameter is a list of fields to copy from the original value. +-- This allows you to specify that, when a collision occurs, you'll just update +-- the value in the database with the field values that you inserted. +-- +-- The third parameter is a list of updates to perform that are independent of +-- the value that is provided. You can use this to increment a counter value. +-- These updates only occur if the original record is present in the database. +insertManyOnDuplicateKeyUpdate + :: ( PersistEntityBackend record ~ SqlBackend + , PersistEntity record + , MonadIO m + ) + => [record] -- ^ A list of the records you want to insert, or
commit ghc-persistent-mysql for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-persistent-mysql for openSUSE:Factory checked in at 2017-06-04 01:58:19 Comparing /work/SRC/openSUSE:Factory/ghc-persistent-mysql (Old) and /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new (New) Package is "ghc-persistent-mysql" Sun Jun 4 01:58:19 2017 rev:3 rq:499719 version:2.6.0.2 Changes: --- /work/SRC/openSUSE:Factory/ghc-persistent-mysql/ghc-persistent-mysql.changes 2017-05-10 20:48:29.559990781 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new/ghc-persistent-mysql.changes 2017-06-04 01:58:20.224846862 +0200 @@ -1,0 +2,5 @@ +Mon May 22 08:08:53 UTC 2017 - psim...@suse.com + +- Update to version 2.6.0.2 with cabal2obs. + +--- Old: persistent-mysql-2.6.0.1.tar.gz New: persistent-mysql-2.6.0.2.tar.gz Other differences: -- ++ ghc-persistent-mysql.spec ++ --- /var/tmp/diff_new_pack.ZOMYZ8/_old 2017-06-04 01:58:20.844759284 +0200 +++ /var/tmp/diff_new_pack.ZOMYZ8/_new 2017-06-04 01:58:20.848758719 +0200 @@ -18,7 +18,7 @@ %global pkg_name persistent-mysql Name: ghc-%{pkg_name} -Version:2.6.0.1 +Version:2.6.0.2 Release:0 Summary:Backend for the persistent library using MySQL database server License:MIT ++ persistent-mysql-2.6.0.1.tar.gz -> persistent-mysql-2.6.0.2.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/persistent-mysql-2.6.0.1/ChangeLog.md new/persistent-mysql-2.6.0.2/ChangeLog.md --- old/persistent-mysql-2.6.0.1/ChangeLog.md 2017-03-01 07:47:28.0 +0100 +++ new/persistent-mysql-2.6.0.2/ChangeLog.md 2017-05-16 20:03:39.0 +0200 @@ -1,3 +1,7 @@ +##2.6.0.2 + +Prevent spurious no-op migrations when `default=NULL` is specified - revised version [#672](https://github.com/yesodweb/persistent/pull/672) (which fixes bug [#671](https://github.com/yesodweb/persistent/issues/671) introduced by the earlier attempt [#641](https://github.com/yesodweb/persistent/pull/641)) + ## 2.6 Compatibility for backend-specific upsert functionality. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/persistent-mysql-2.6.0.1/Database/Persist/MySQL.hs new/persistent-mysql-2.6.0.2/Database/Persist/MySQL.hs --- old/persistent-mysql-2.6.0.1/Database/Persist/MySQL.hs 2017-03-03 10:45:56.0 +0100 +++ new/persistent-mysql-2.6.0.2/Database/Persist/MySQL.hs 2017-05-16 20:03:39.0 +0200 @@ -457,7 +457,7 @@ stmtIdClmn <- getter "SELECT COLUMN_NAME, \ \IS_NULLABLE, \ \DATA_TYPE, \ - \IF(IS_NULLABLE='YES', COALESCE(COLUMN_DEFAULT, 'NULL'), COLUMN_DEFAULT) \ + \COLUMN_DEFAULT \ \FROM INFORMATION_SCHEMA.COLUMNS \ \WHERE TABLE_SCHEMA = ? \ \AND TABLE_NAME = ? \ @@ -473,7 +473,7 @@ \CHARACTER_MAXIMUM_LENGTH, \ \NUMERIC_PRECISION, \ \NUMERIC_SCALE, \ - \IF(IS_NULLABLE='YES', COALESCE(COLUMN_DEFAULT, 'NULL'), COLUMN_DEFAULT) \ + \COLUMN_DEFAULT \ \FROM INFORMATION_SCHEMA.COLUMNS \ \WHERE TABLE_SCHEMA = ? \ \AND TABLE_NAME = ? \ @@ -691,10 +691,12 @@ modType | showSqlType type_ maxLen False `ciEquals` showSqlType type_' maxLen' False && isNull == isNull' = [] | otherwise = [(name, Change col)] -- Default value +-- Avoid DEFAULT NULL, since it is always unnecessary, and is an error for text/blob fields modDef | def == def' = [] | otherwise = case def of Nothing -> [(name, NoDefault)] - Just s -> [(name, Default $ T.unpack s)] + Just s -> if T.toUpper s == "NULL" then [] + else [(name, Default $ T.unpack s)] in ( refDrop ++ modType ++ modDef ++ refAdd , filter ((name /=) . cName) cols ) @@ -715,7 +717,9 @@ , if nu then "NULL" else "NOT NULL" , case def of Nothing -> "" -Just s -> " DEFAULT " ++ T.unpack s +Just s -> -- Avoid DEFAULT NULL, since it is always unnecessary, and is an error for
commit ghc-persistent-mysql for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-persistent-mysql for openSUSE:Factory checked in at 2017-05-10 20:48:27 Comparing /work/SRC/openSUSE:Factory/ghc-persistent-mysql (Old) and /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new (New) Package is "ghc-persistent-mysql" Wed May 10 20:48:27 2017 rev:2 rq:489362 version:2.6.0.1 Changes: --- /work/SRC/openSUSE:Factory/ghc-persistent-mysql/ghc-persistent-mysql.changes 2017-04-12 18:08:18.421059863 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-persistent-mysql.new/ghc-persistent-mysql.changes 2017-05-10 20:48:29.559990781 +0200 @@ -1,0 +2,5 @@ +Tue Mar 14 09:26:15 UTC 2017 - psim...@suse.com + +- Update to version 2.6.0.1 with cabal2obs. + +--- Old: persistent-mysql-2.6.tar.gz persistent-mysql.cabal New: persistent-mysql-2.6.0.1.tar.gz Other differences: -- ++ ghc-persistent-mysql.spec ++ --- /var/tmp/diff_new_pack.HKTnDp/_old 2017-05-10 20:48:31.975649916 +0200 +++ /var/tmp/diff_new_pack.HKTnDp/_new 2017-05-10 20:48:31.979649351 +0200 @@ -18,14 +18,13 @@ %global pkg_name persistent-mysql Name: ghc-%{pkg_name} -Version:2.6 +Version:2.6.0.1 Release:0 Summary:Backend for the persistent library using MySQL database server License:MIT Group: Development/Languages/Other 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/2.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-blaze-builder-devel @@ -70,7 +69,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++ persistent-mysql-2.6.tar.gz -> persistent-mysql-2.6.0.1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/persistent-mysql-2.6/Database/Persist/MySQL.hs new/persistent-mysql-2.6.0.1/Database/Persist/MySQL.hs --- old/persistent-mysql-2.6/Database/Persist/MySQL.hs 2016-08-10 05:20:24.0 +0200 +++ new/persistent-mysql-2.6.0.1/Database/Persist/MySQL.hs 2017-03-03 10:45:56.0 +0100 @@ -20,7 +20,7 @@ import Control.Monad.Logger (MonadLogger, runNoLoggingT) import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.Class (lift) -import Control.Monad.Trans.Error (ErrorT(..)) +import Control.Monad.Trans.Except (runExceptT) import Control.Monad.Trans.Reader (runReaderT) import Control.Monad.Trans.Writer (runWriterT) import Data.Monoid ((<>)) @@ -124,6 +124,7 @@ , connRDBMS = "mysql" , connLimitOffset = decorateSQLWithLimitOffset "LIMIT 18446744073709551615" , connLogFunc= logFunc +, connMaxParams = Nothing } -- | Prepare a query. We don't support prepared statements, but @@ -456,7 +457,7 @@ stmtIdClmn <- getter "SELECT COLUMN_NAME, \ \IS_NULLABLE, \ \DATA_TYPE, \ - \COLUMN_DEFAULT \ + \IF(IS_NULLABLE='YES', COALESCE(COLUMN_DEFAULT, 'NULL'), COLUMN_DEFAULT) \ \FROM INFORMATION_SCHEMA.COLUMNS \ \WHERE TABLE_SCHEMA = ? \ \AND TABLE_NAME = ? \ @@ -467,8 +468,12 @@ -- Find out all columns. stmtClmns <- getter "SELECT COLUMN_NAME, \ \IS_NULLABLE, \ + \DATA_TYPE, \ \COLUMN_TYPE, \ - \COLUMN_DEFAULT \ + \CHARACTER_MAXIMUM_LENGTH, \ + \NUMERIC_PRECISION, \ + \NUMERIC_SCALE, \ + \IF(IS_NULLABLE='YES', COALESCE(COLUMN_DEFAULT, 'NULL'), COLUMN_DEFAULT) \ \FROM INFORMATION_SCHEMA.COLUMNS \ \WHERE TABLE_SCHEMA = ? \ \AND TABLE_NAME = ? \ @@ -519,10 +524,14 @@ -> IO (Either Text Column) getColumn connectInfo getter tname [ PersistText cname , PersistText null_ - , PersistText type' + , PersistText dataType + , PersistText colType + , colMaxLen + ,