stack-3.1.1: The Haskell Tool Stack
Safe HaskellNone
LanguageGHC2021

Stack.Storage.Util

Description

Utils for the other Stack.Storage modules

Synopsis

Documentation

updateCollection :: forall record backend collection rawValue value (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, Eq (collection rawValue), PersistEntity record, PersistField value, MonadIO m, PersistQueryWrite backend, SafeToInsert record, Foldable collection) => (collection rawValue -> collection rawValue -> ([Filter record], [value])) -> (value -> record) -> [Filter record] -> collection rawValue -> collection rawValue -> ReaderT backend m () Source #

Efficiently update a collection of values with a given diff function.

setUpdateDiff :: (Ord value, PersistField value) => EntityField record value -> Set value -> Set value -> ([Filter record], [value]) Source #

listUpdateDiff :: Ord value => EntityField record Int -> [value] -> [value] -> ([Filter record], [(Int, value)]) Source #