morphismtech / squeal

Squeal, a deep embedding of SQL in Haskell
350 stars 32 forks source link

safe transactions #290

Closed echatav closed 3 years ago

echatav commented 3 years ago

This adds proof-of-concept safe/unsafe Transactions. Unsafe means you can run arbitrary IO while safe means you can only run database operations, pure code, and synchronous exception handling. It works by defining a safe Transaction frankentype.

type Transaction db x = forall m. (MonadPQ db m, MonadResult m, MonadCatch m) => m x