Split maybeOfferCreate from makeTransactions
[rootstock.git] / Util / Persist.hs
blobc00763a48655d79af9e767c2e87b80889941f446
1 {-# LANGUAGE TypeFamilies #-}
2 module Util.Persist where
3 import Database.Persist.Class
4 import Database.Persist.Types
6 insertReturnEntity ::
7 ( PersistStore m
8 , PersistMonadBackend m ~ PersistEntityBackend val
9 , PersistEntity val)
10 => val -> m (Entity val)
11 insertReturnEntity x = do
12 key <- insert x
13 return $ Entity {entityKey = key, entityVal = x}