Delete old stuff from main

This commit is contained in:
Paul Brinkmeier 2023-01-06 01:41:56 +01:00
parent fa2d060143
commit b58efa1fc2

View File

@ -24,7 +24,7 @@ import Jon.Server (JonAPI, jonSwaggerDoc, server)
main :: IO () main :: IO ()
main = withGarfieldConn $ \conn -> main = withGarfieldConn $ \conn ->
run 8080 $ serve p $ server conn :<|> swaggerSchemaUIServer jonSwaggerDoc :<|> serveDirectoryFileServer "./static" run 8080 $ serve p (server conn :<|> swaggerSchemaUIServer jonSwaggerDoc :<|> serveDirectoryFileServer "./static")
where where
p :: Proxy (JonAPI :<|> SwaggerSchemaUI "swagger" "swagger.json" :<|> Raw) p :: Proxy (JonAPI :<|> SwaggerSchemaUI "swagger" "swagger.json" :<|> Raw)
p = Proxy p = Proxy
@ -34,19 +34,3 @@ withGarfieldConn = bracket
(do pass <- getEnv "JON_PASS" (do pass <- getEnv "JON_PASS"
connectPostgreSQL $ BS8.pack $ "host=localhost dbname=garfield password=" ++ pass) connectPostgreSQL $ BS8.pack $ "host=localhost dbname=garfield password=" ++ pass)
close close
runQuery
:: (FromBackendRow Postgres (QExprToIdentity e), Projectible Postgres e)
=> Q Postgres db QBaseScope e
-> IO [QExprToIdentity e]
runQuery q = withGarfieldConn $ \conn -> runBeamPostgresDebug putStrLn conn $ runSelectReturningList $ select q
runIns
:: SqlInsert Postgres table
-> IO ()
runIns i = withGarfieldConn $ \conn -> runBeamPostgresDebug putStrLn conn $ runInsert i
runFunction
:: (Connection -> IO a)
-> IO a
runFunction = withGarfieldConn