It all compiles but all requests give a postgres error

This commit is contained in:
Joe Nelson
2016-01-24 18:09:19 -08:00
parent fec316b087
commit b9fd083c77
10 changed files with 43 additions and 47 deletions
+4 -5
View File
@@ -38,17 +38,16 @@ cfgDefault = cfg dbString Nothing
cfgLimitRows :: Integer -> AppConfig
cfgLimitRows = cfg dbString . Just
withApp :: AppConfig -> DbStructure -> Pool H.Connection
withApp :: AppConfig -> DbStructure -> H.Connection
-> ActionWith Application -> IO ()
withApp config dbStructure pool perform = do
withApp config dbStructure c perform = do
perform $ defaultMiddle $ \req resp -> do
time <- getPOSIXTime
body <- strictRequestBody req
let handleReq = H.run (runWithClaims config time (app dbStructure config body) req)
withResource pool $ \c -> do
resOrError <- handleReq c
either (resp . pgErrResponse) resp resOrError
resOrError <- handleReq c
either (resp . pgErrResponse) resp resOrError
setupDb :: IO ()
setupDb = do