Bump opium to remove dependency on postgresql-libpq
This commit is contained in:
parent
fda4e7530c
commit
a499c35d5b
@ -2,13 +2,13 @@
|
||||
|
||||
module Main (main) where
|
||||
|
||||
import Database.PostgreSQL.LibPQ (connectdb)
|
||||
import qualified Database.PostgreSQL.Opium as Opium
|
||||
|
||||
import qualified Yore.DB
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
conn <- connectdb "host=localhost port=5432"
|
||||
conn <- Opium.connect "host=localhost port=5432"
|
||||
result <- Yore.DB.getTables conn
|
||||
|
||||
case result of
|
||||
|
||||
8
flake.lock
generated
8
flake.lock
generated
@ -64,11 +64,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1752596794,
|
||||
"narHash": "sha256-1J3tNaosj3DCQuzDCPdbEbOd5ZQuqIOAVD7o5hFNx+g=",
|
||||
"lastModified": 1752614832,
|
||||
"narHash": "sha256-rwLQ1xsYus6on4PSTwM2ti36Iwk5gr9lDKwFOZ451OI=",
|
||||
"ref": "main",
|
||||
"rev": "3879c2603fa124087a3ed810903bf75d38a27598",
|
||||
"revCount": 56,
|
||||
"rev": "2fddc958b9e6b616f89570dfa44503bccd165c02",
|
||||
"revCount": 59,
|
||||
"type": "git",
|
||||
"url": "https://git.pbrinkmeier.de/paul/opium"
|
||||
},
|
||||
|
||||
@ -5,7 +5,6 @@ module Yore.DB
|
||||
, getTables
|
||||
) where
|
||||
|
||||
import Database.PostgreSQL.LibPQ (Connection)
|
||||
import GHC.Generics (Generic)
|
||||
|
||||
import qualified Database.PostgreSQL.Opium as Opium
|
||||
@ -17,5 +16,5 @@ data Table = Table
|
||||
|
||||
instance Opium.FromRow Table
|
||||
|
||||
getTables :: Connection -> IO (Either Opium.Error [Table])
|
||||
getTables :: Opium.Connection -> IO (Either Opium.Error [Table])
|
||||
getTables = Opium.fetch_ "SELECT table_schema AS schema, table_name AS name FROM information_schema.tables"
|
||||
|
||||
@ -2,12 +2,10 @@
|
||||
|
||||
module Yore.Repl (connect, exec) where
|
||||
|
||||
import qualified Database.PostgreSQL.LibPQ as LibPQ
|
||||
import qualified Database.PostgreSQL.Opium as Opium
|
||||
|
||||
import Database.PostgreSQL.LibPQ (Connection)
|
||||
connect :: IO Opium.Connection
|
||||
connect = Opium.connect "host=localhost"
|
||||
|
||||
connect :: IO Connection
|
||||
connect = LibPQ.connectdb "host=localhost"
|
||||
|
||||
exec :: (Connection -> IO a) -> IO a
|
||||
exec :: (Opium.Connection -> IO a) -> IO a
|
||||
exec f = f =<< connect
|
||||
|
||||
@ -38,7 +38,6 @@ library
|
||||
build-depends:
|
||||
base >=4.18 && <5
|
||||
, opium
|
||||
, postgresql-libpq
|
||||
|
||||
executable yore
|
||||
import: shared-options
|
||||
@ -57,7 +56,6 @@ executable yore
|
||||
, bytestring
|
||||
, http-media
|
||||
, opium
|
||||
, postgresql-libpq
|
||||
, servant-server
|
||||
, text
|
||||
, wai
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user