Main.hs 612 B

123456789101112131415161718192021222324
  1. {-# LANGUAGE OverloadedStrings #-}
  2. module Main where
  3. import qualified Lib
  4. import qualified GHC.Conc
  5. import System.Environment (getArgs)
  6. main :: IO ()
  7. main = do
  8. args <- getArgs
  9. dbHost <- case args of
  10. [x] -> pure x
  11. _ -> pure "0.0.0.0"
  12. -- _ -> fail "Usage: warp-postgres-wire <DATABASE_HOST>"
  13. numCaps <- GHC.Conc.getNumCapabilities
  14. Lib.main $ Lib.Config {
  15. Lib.configHost = dbHost,
  16. Lib.configName = "hello_world",
  17. Lib.configUser = "benchmarkdbuser",
  18. Lib.configPass = "benchmarkdbpass",
  19. Lib.configStripes = numCaps,
  20. Lib.configPoolSize= 512
  21. }