You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The monad that is added to the monad transformer stack and maintains the database connection pool / transaction information should be separate from the monad that executes SQL queries in a transaction.
Effectively, SqlTransaction should be the same thing as persistent's SqlPersistT type, except we want to restrict unsafe IO actions, like forkIO (see #7) or IO actions that aren't rerunnable. This is so that databases where transactions are expected to be retried if serialization fails (e.g. https://www.postgresql.org/docs/9.5/transaction-iso.html).
Add separate SqlTransaction type
SqlTransaction should forbid MonadIO instances (using GHC.TypeLits.TypeError)
Add MonadRerunnableIO class + instance
with rerunnableIO and rerunnableM
Write withTransaction :: SqlTransaction m a -> m a
Test SqlTransaction does not allow arbitrary IO
Update docs
Update README, haddocks, etc.
Update CHANGELOG
The text was updated successfully, but these errors were encountered:
The monad that is added to the monad transformer stack and maintains the database connection pool / transaction information should be separate from the monad that executes SQL queries in a transaction.
Effectively,
SqlTransaction
should be the same thing as persistent'sSqlPersistT
type, except we want to restrict unsafe IO actions, likeforkIO
(see #7) or IO actions that aren't rerunnable. This is so that databases where transactions are expected to be retried if serialization fails (e.g. https://www.postgresql.org/docs/9.5/transaction-iso.html).SqlTransaction
typeSqlTransaction
should forbidMonadIO
instances (usingGHC.TypeLits.TypeError
)MonadRerunnableIO
class + instancererunnableIO
andrerunnableM
withTransaction :: SqlTransaction m a -> m a
SqlTransaction
does not allow arbitrary IOThe text was updated successfully, but these errors were encountered: