-
I'm looking at how to integrate talking to a PostgreSQL as an effect. Directly exposing What I'd like to have would be
Going directly from |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I don't have an answer, but there's hpqtypes-effectful that implements an adapter for hpqtypes that does what you want, i.e. exposes access to PostgreSQL as an effect and has support for basic transaction management. If you really want to use the libraries you've listed, perhaps you can use code from hpqtypes-effectful as inspiration. |
Beta Was this translation helpful? Give feedback.
-
My personal opinion on transactions is effects is you want something more like: data DB :: Effect
data Statement :: Effect
transaction :: DB :> es => IsolationLevel -> Eff '[Statement] a -> Eff es a
runDB :: Pool -> Eff (DB : es) a -> Eff es a I don't think a |
Beta Was this translation helpful? Give feedback.
-
After spending more time with the library, i think exposing |
Beta Was this translation helpful? Give feedback.
After spending more time with the library, i think exposing
DBT
directly is not an issue, similar to what is done with theSTM
monad.