persistent-test-2.12.0.0: Tests for Persistent
Safe HaskellNone
LanguageHaskell2010

UpsertTest

Synopsis

Documentation

data BackendNullUpdateBehavior Source #

MongoDB assumes that a NULL value in the database is some "empty" value. So a query that does + 2 to a NULL value results in 2. SQL databases instead "annihilate" with null, so NULL + 2 = NULL.

data BackendUpsertKeyBehavior Source #

UPSERT on SQL databses does an "update-or-insert," which preserves all prior values, including keys. MongoDB does not preserve the identifier, so the entity key changes on an upsert.

specsWith :: forall backend m. Runner backend m => RunDb backend m -> BackendNullUpdateBehavior -> BackendUpsertKeyBehavior -> Spec Source #