runConnectionPool :: MonadControlIO m => SqlPersist m a -> ConnectionPool -> m a runConnectionPool = runSqlPool withConnectionPool :: MonadControlIO m => AppConfig -> (ConnectionPool -> m a) -> m a withConnectionPool conf f = do cs <- liftIO $ load~upper~ConnStr (appEnv conf) with~upper~Pool cs (connectionPoolSize conf) f -- Example of making a dynamic configuration static -- use /return $(mkConnStr Production)/ instead of loadConnStr -- mkConnStr :: AppEnvironment -> Q Exp -- mkConnStr env = qRunIO (loadConnStr env) >>= return . LitE . StringL