yore/app/Main.hs
Paul Brinkmeier 80f2e52327 Bump opium
2025-07-20 02:54:48 +02:00

22 lines
525 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Exception (bracket)
import qualified Database.PostgreSQL.Opium as Opium
import qualified Yore.DB
main :: IO ()
main = bracket unsafeConnect Opium.close $ \conn -> do
result <- Yore.DB.getTables conn
case result of
Left e ->
putStrLn $ "Got error: " ++ show e
Right rows ->
mapM_ print rows
where
unsafeConnect = either (error . show) id <$> Opium.connect "host=localhost port=5432 user=yore-test dbname=yore-test"