Bump opium
This commit is contained in:
parent
1a6d2cadad
commit
80f2e52327
@ -1,2 +1,5 @@
|
||||
# yore
|
||||
|
||||
## Inspo
|
||||
|
||||
- https://fz.ub.uni-freiburg.de/show/fz.cgi?pKuerzel=FZ
|
||||
|
||||
@ -9,7 +9,7 @@ import qualified Database.PostgreSQL.Opium as Opium
|
||||
import qualified Yore.DB
|
||||
|
||||
main :: IO ()
|
||||
main = bracket (Opium.connect "host=localhost port=5432 user=yore-test dbname=yore-test") Opium.close $ \conn -> do
|
||||
main = bracket unsafeConnect Opium.close $ \conn -> do
|
||||
result <- Yore.DB.getTables conn
|
||||
|
||||
case result of
|
||||
@ -17,3 +17,5 @@ main = bracket (Opium.connect "host=localhost port=5432 user=yore-test dbname=yo
|
||||
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"
|
||||
|
||||
8
flake.lock
generated
8
flake.lock
generated
@ -64,11 +64,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1752614832,
|
||||
"narHash": "sha256-rwLQ1xsYus6on4PSTwM2ti36Iwk5gr9lDKwFOZ451OI=",
|
||||
"lastModified": 1752972533,
|
||||
"narHash": "sha256-jhVfZK05aRtQ6FqLfLrhpGk8bRAkpXXXxVx4DhJgQVY=",
|
||||
"ref": "main",
|
||||
"rev": "2fddc958b9e6b616f89570dfa44503bccd165c02",
|
||||
"revCount": 59,
|
||||
"rev": "b39da29d139763f41bffcc8c4c175e472d672f45",
|
||||
"revCount": 61,
|
||||
"type": "git",
|
||||
"url": "https://git.pbrinkmeier.de/paul/opium"
|
||||
},
|
||||
|
||||
1
src/Yore/Download.hs
Normal file
1
src/Yore/Download.hs
Normal file
@ -0,0 +1 @@
|
||||
module Yore.Download () where
|
||||
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Yore.Repl (connect, exec) where
|
||||
@ -5,7 +6,10 @@ module Yore.Repl (connect, exec) where
|
||||
import qualified Database.PostgreSQL.Opium as Opium
|
||||
|
||||
connect :: IO Opium.Connection
|
||||
connect = Opium.connect "host=localhost"
|
||||
connect =
|
||||
Opium.connect "host=localhost" >>= \case
|
||||
Left e -> error $ show e
|
||||
Right c -> pure c
|
||||
|
||||
exec :: (Opium.Connection -> IO a) -> IO a
|
||||
exec f = f =<< connect
|
||||
|
||||
@ -33,6 +33,7 @@ library
|
||||
exposed-modules:
|
||||
Yore.DB
|
||||
, Yore.Repl
|
||||
, Yore.Download
|
||||
hs-source-dirs:
|
||||
src
|
||||
build-depends:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user