diff --git a/persistent-mongoDB/ChangeLog.md b/persistent-mongoDB/ChangeLog.md index c22956ef2..311bbd35a 100644 --- a/persistent-mongoDB/ChangeLog.md +++ b/persistent-mongoDB/ChangeLog.md @@ -1,3 +1,8 @@ +## 2.9.0 + +* Removed deprecated `entityToDocument`. Please use `recordToDocument` instead. [#894](https://github.com/yesodweb/persistent/pull/894) +* Removed deprecated `multiBsonEq`. Please use `anyBsonEq` instead. [#894](https://github.com/yesodweb/persistent/pull/894) + ## 2.8.0 * Switch from `MonadBaseControl` to `MonadUnliftIO` diff --git a/persistent-mongoDB/Database/Persist/MongoDB.hs b/persistent-mongoDB/Database/Persist/MongoDB.hs index bb4019e99..4d196875c 100644 --- a/persistent-mongoDB/Database/Persist/MongoDB.hs +++ b/persistent-mongoDB/Database/Persist/MongoDB.hs @@ -28,7 +28,6 @@ module Database.Persist.MongoDB collectionName , docToEntityEither , docToEntityThrow - , entityToDocument , recordToDocument , documentFromEntity , toInsertDoc @@ -43,7 +42,7 @@ module Database.Persist.MongoDB -- ** Filters -- $filters , nestEq, nestNe, nestGe, nestLe, nestIn, nestNotIn - , anyEq, nestAnyEq, nestBsonEq, anyBsonEq, multiBsonEq + , anyEq, nestAnyEq, nestBsonEq, anyBsonEq , inList, ninList , (=~.) -- non-operator forms of filters @@ -414,7 +413,7 @@ toUniquesDoc uniq = zipWith (DB.:=) -- | convert a PersistEntity into document fields. -- for inserts only: nulls are ignored so they will be unset in the document. --- 'entityToDocument' includes nulls +-- 'recordToDocument' includes nulls toInsertDoc :: forall record. (PersistEntity record, PersistEntityBackend record ~ DB.MongoContext) => record -> DB.Document toInsertDoc record = zipFilter (embeddedFields $ toEmbedEntityDef entDef) @@ -459,15 +458,10 @@ recordToDocument record = zipToDoc (map fieldDB $ entityFields entity) (toPersis where entity = entityDef $ Just record -entityToDocument :: (PersistEntity record, PersistEntityBackend record ~ DB.MongoContext) - => record -> DB.Document -entityToDocument = recordToDocument -{-# DEPRECATED entityToDocument "use recordToDocument" #-} - documentFromEntity :: (PersistEntity record, PersistEntityBackend record ~ DB.MongoContext) => Entity record -> DB.Document documentFromEntity (Entity key record) = - keyToMongoDoc key ++ entityToDocument record + keyToMongoDoc key ++ recordToDocument record zipToDoc :: PersistField a => [DBName] -> [a] -> [DB.Field] zipToDoc [] _ = [] @@ -1339,7 +1333,6 @@ infixr 4 `nestNotIn` infixr 4 `anyEq` infixr 4 `nestAnyEq` infixr 4 `nestBsonEq` -infixr 4 `multiBsonEq` infixr 4 `anyBsonEq` infixr 4 `nestSet` @@ -1405,13 +1398,6 @@ nestAnyEq :: forall record typ. fld `nestAnyEq` val = BackendFilter $ NestedArrayFilter fld $ PersistFilterOperator (FilterValue val) Eq -multiBsonEq :: forall record typ. - ( PersistField typ - , PersistEntityBackend record ~ DB.MongoContext - ) => EntityField record [typ] -> DB.Value -> Filter record -multiBsonEq = anyBsonEq -{-# DEPRECATED multiBsonEq "Please use anyBsonEq instead" #-} - -- | same as `anyEq`, but give a BSON Value anyBsonEq :: forall record typ. ( PersistField typ diff --git a/persistent-mysql/ChangeLog.md b/persistent-mysql/ChangeLog.md index ec08ae9ab..2198a12c7 100644 --- a/persistent-mysql/ChangeLog.md +++ b/persistent-mysql/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog for persistent-mysql +## 2.10.0 (unreleased) + +* Remove deprecated `SomeField` type and pattern synonym. Use `HandleUpdateCollision` type instead and the `copyField` function instead of `SomeField` constructor/pattern. [#894](https://github.com/yesodweb/persistent/pull/894) + ## 2.9.0 * Added support for SQL isolation levels to via SqlBackend. [#812] diff --git a/persistent-mysql/Database/Persist/MySQL.hs b/persistent-mysql/Database/Persist/MySQL.hs index f0db08bca..3fdf0ef40 100644 --- a/persistent-mysql/Database/Persist/MySQL.hs +++ b/persistent-mysql/Database/Persist/MySQL.hs @@ -1068,7 +1068,7 @@ insertOnDuplicateKeyUpdate record = -- @INSERT ... ON DUPLICATE KEY UPDATE@ functionality, exposed via -- 'insertManyOnDuplicateKeyUpdate' in this library. -- --- @since 3.0.0 +-- @since 2.8.0 data HandleUpdateCollision record where -- | Copy the field directly from the record. CopyField :: EntityField record typ -> HandleUpdateCollision record @@ -1311,4 +1311,4 @@ putManySql' fields ent n = q . Util.parenWrapped . Util.commaSeparated $ placeholders , " ON DUPLICATE KEY UPDATE " , Util.commaSeparated updates - ] \ No newline at end of file + ] diff --git a/persistent-mysql/persistent-mysql.cabal b/persistent-mysql/persistent-mysql.cabal index 4c6107a8e..d2f81f7c6 100644 --- a/persistent-mysql/persistent-mysql.cabal +++ b/persistent-mysql/persistent-mysql.cabal @@ -1,5 +1,5 @@ name: persistent-mysql -version: 2.9.0 +version: 2.10.0 license: MIT license-file: LICENSE author: Felipe Lessa , Michael Snoyman diff --git a/persistent-template/ChangeLog.md b/persistent-template/ChangeLog.md index acba953bb..a841fb789 100644 --- a/persistent-template/ChangeLog.md +++ b/persistent-template/ChangeLog.md @@ -1,6 +1,7 @@ -## 2.7.0 +## 2.7.0 (unreleased) * Depends on `persistent-2.10.0` which provides the `OnlyOneUniqueKey` and `AtLeastOneUniqueKey` classes. Automatically generates instances for these classes based on how many unique keys the entity definition gets. This changes requires `UndecidableInstances` to be enabled on each module that generates entity definitions. [#885](https://github.com/yesodweb/persistent/pull/885) +* Removed deprecated `sqlOnlySettings`. Please use `sqlSettings` instead. [#894](https://github.com/yesodweb/persistent/pull/894) ## 2.6.0 * [persistent#846](https://github.com/yesodweb/persistent/pull/846): Improve error message when marshalling fails diff --git a/persistent-template/Database/Persist/TH.hs b/persistent-template/Database/Persist/TH.hs index cceef9af0..5df4c7c31 100644 --- a/persistent-template/Database/Persist/TH.hs +++ b/persistent-template/Database/Persist/TH.hs @@ -28,7 +28,6 @@ module Database.Persist.TH , EntityJSON(..) , mkPersistSettings , sqlSettings - , sqlOnlySettings -- * Various other TH functions , mkMigrate , mkSave @@ -430,13 +429,6 @@ mkPersistSettings t = MkPersistSettings sqlSettings :: MkPersistSettings sqlSettings = mkPersistSettings $ ConT ''SqlBackend --- | Same as 'sqlSettings'. --- --- @since 1.1.1 -sqlOnlySettings :: MkPersistSettings -sqlOnlySettings = sqlSettings -{-# DEPRECATED sqlOnlySettings "use sqlSettings" #-} - recNameNoUnderscore :: MkPersistSettings -> HaskellName -> HaskellName -> Text recNameNoUnderscore mps dt f | mpsPrefixFields mps = lowerFirst (unHaskellName dt) ++ upperFirst ft diff --git a/persistent/ChangeLog.md b/persistent/ChangeLog.md index 42789b10a..c8dace735 100644 --- a/persistent/ChangeLog.md +++ b/persistent/ChangeLog.md @@ -1,10 +1,12 @@ # Changelog for persistent -## 2.10.0 +## 2.10.0 (unreleased) * Added two type classes `OnlyOneUniqueKey` and `AtLeastOneUniqueKey`. These classes are used as constraints on functions that expect a certain amount of unique keys. They are defined automatically as part of the `persistent-template`'s generation. [#885](https://github.com/yesodweb/persistent/pull/885) * Add the `entityComments` field to the `EntityDef` datatype, and `fieldComments` fields to the `FieldDef` datatype. The QuasiQuoter does not currently know how to add documentation comments to these types, but it can be expanded later. [#865](https://github.com/yesodweb/persistent/pull/865) * Expose the `SqlReadT` and `SqlWriteT` constructors. [#887](https://github.com/yesodweb/persistent/pull/887) +* Remove deprecated `Connection` type synonym. Please use `SqlBackend` instead. [#894](https://github.com/yesodweb/persistent/pull/894) +* Remove deprecated `SqlPersist` type synonym. Please use `SqlPersistT` instead. [#894](https://github.com/yesodweb/persistent/pull/894) ## 2.9.2 diff --git a/persistent/Database/Persist/Sql/Types.hs b/persistent/Database/Persist/Sql/Types.hs index 52911ed48..58b573a51 100644 --- a/persistent/Database/Persist/Sql/Types.hs +++ b/persistent/Database/Persist/Sql/Types.hs @@ -18,10 +18,6 @@ import Data.Typeable (Typeable) import Database.Persist.Types import Database.Persist.Sql.Types.Internal --- | Deprecated synonym for @SqlBackend@. -type Connection = SqlBackend -{-# DEPRECATED Connection "Please use SqlBackend instead" #-} - data Column = Column { cName :: !DBName , cNull :: !Bool @@ -40,9 +36,6 @@ instance Exception PersistentSqlException type SqlPersistT = ReaderT SqlBackend -type SqlPersist = SqlPersistT -{-# DEPRECATED SqlPersist "Please use SqlPersistT instead" #-} - type SqlPersistM = SqlPersistT (NoLoggingT (ResourceT IO)) type Sql = Text