| Safe Haskell | None |
|---|
ClassyPrelude.Yesod
- insertDB :: (PersistStore m, PersistEntity entity, PersistMonadBackend m ~ PersistEntityBackend entity) => entity -> m (Key entity)
- voidKey :: Functor m => m (KeyBackend backend entity) -> m ()
Documentation
insertDB :: (PersistStore m, PersistEntity entity, PersistMonadBackend m ~ PersistEntityBackend entity) => entity -> m (Key entity)Source
Non-typeclass insert for use with Persistent.
If you don't use the Key returned from insert, the type inferencing
cannot tell which insert function to use. Using insertDB disambiguates.
Another options is using voidKey.
Since 0.1.0.0
voidKey :: Functor m => m (KeyBackend backend entity) -> m ()Source
Ignore the Key returned by insert.
See insertDB for more information. The following two lines are equivalent:
_ <- insertDB foo voidKey $ insert foo
Since 0.1.0.0