packages feed

persistent 2.1.0.2 → 2.1.1

raw patch · 3 files changed

+14/−2 lines, 3 files

Files

Database/Persist/Class/PersistStore.hs view
@@ -83,7 +83,7 @@     --     -- If you don't need the inserted @Key@s, use 'insertMany_'     ---    -- SQL backends currently use the slow default implementation of+    -- Some backends use the slow default implementation of     -- @mapM insert@     insertMany :: (MonadIO m, backend ~ PersistEntityBackend val, PersistEntity val)                => [val] -> ReaderT backend m [Key val]@@ -96,6 +96,17 @@     insertMany_ :: (MonadIO m, backend ~ PersistEntityBackend val, PersistEntity val)                 => [val] -> ReaderT backend m ()     insertMany_ x = insertMany x >> return ()++    -- | Same as 'insertMany_', but takes an 'Entity' instead of just a record+    --+    -- Useful when migrating data from one entity to another+    -- and want to preserve ids+    --+    -- Some backends use the slow default implementation of+    -- @mapM insertKey@+    insertEntityMany :: (MonadIO m, backend ~ PersistEntityBackend val, PersistEntity val)+                     => [Entity val] -> ReaderT backend m ()+    insertEntityMany = mapM_ (\(Entity k record) -> insertKey k record)      -- | Create a new record in the database using the given key.     insertKey :: (MonadIO m, backend ~ PersistEntityBackend val, PersistEntity val)
Database/Persist/Sql/Orphan/PersistStore.hs view
@@ -47,6 +47,7 @@ fromSqlKey :: ToBackendKey SqlBackend record => Key record -> Int64 fromSqlKey = unSqlBackendKey . toBackendKey +whereStmtForKey :: PersistEntity record => SqlBackend -> Key record -> Text whereStmtForKey conn k =   case entityPrimary t of     Just pdef -> T.intercalate " AND " $ map (\fld -> connEscapeName conn (fieldDB fld) <> "=? ") $ compositeFields pdef
persistent.cabal view
@@ -1,5 +1,5 @@ name:            persistent-version:         2.1.0.2+version:         2.1.1 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>