Bump opium to remove dependency on postgresql-libpq
This commit is contained in:
+1
-2
@@ -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"
|
||||
|
||||
+4
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user