yesod/yesod/scaffold/mongoDBConnPool.cg
2011-09-21 18:52:57 -04:00

9 lines
419 B
Plaintext

runConnectionPool :: MonadControlIO m => Action m a -> ConnectionPool -> m a
runConnectionPool = runMongoDBConn (ConfirmWrites [u"j" =: True])
withConnectionPool :: (MonadControlIO m, Applicative m) => AppConfig DefaultEnv -> (ConnectionPool -> m b) -> m b
withConnectionPool conf f = do
dbConf <- liftIO $ loadMongo (appEnv conf)
withMongoDBPool (u $ mgDatabase dbConf) (mgHost dbConf) (mgPoolSize dbConf) f