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
With new type for withConn :: (conn -> m a) -> conn -> m a, I'm confused about how to write a ConnectionManager instance for snap that defers to the ConnectionManager instance for Pool Postgresql.
What I have so far:
data App = App { _heist :: Snaplet (Heist App), _db :: Pool Postgresql }
instance ConnectionManager App where
withConn f app@(App _ pg) = do
pgConn <- extractConnection return pg
let g = _ f
withConn g pgConn
It seems I need to somehow create a function g :: Postgresql -> m a out of the function f :: App -> m a if I want to use Postgresql's ConnectionManager instance, but it seems impossible to generate such a function.
Maybe I'm going down the wrong route? The ultimate goal is just to provide a convenience function for running groundhog queries from within my Handler App App monad.
The text was updated successfully, but these errors were encountered:
Hi @imalsogreg. Sorry, I was not able to put as much effort to Groundhog as before and seldom checked the notifications. Have you found a solution for this issue?
I have at least a workaround for now. Rather than write a instance ConnectionManager App, I just use the instance from the connection itself. Do you think you will step back from groundhog permanently? If so, would you like help maintaining it?
I plan to support Groundhog indefinitely and release pipes/conduit integration sometime in the future. Yet, it would be hard to keep the same level of activity as a couple of years ago. Any help with the maintenance would be invaluable.
With new type for
withConn :: (conn -> m a) -> conn -> m a
, I'm confused about how to write aConnectionManager
instance for snap that defers to theConnectionManager
instance forPool Postgresql
.What I have so far:
It seems I need to somehow create a function
g :: Postgresql -> m a
out of the functionf :: App -> m a
if I want to usePostgresql
'sConnectionManager
instance, but it seems impossible to generate such a function.Maybe I'm going down the wrong route? The ultimate goal is just to provide a convenience function for running groundhog queries from within my
Handler App App
monad.The text was updated successfully, but these errors were encountered: