Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Gargoyle.PostgreSQL.Connect (withDb, withDb', openDb) where
module Gargoyle.PostgreSQL.Connect (openDb, withDb, withDb', withDbPath) where

import Control.Monad ((>=>))
import Data.ByteString (ByteString)
Expand Down Expand Up @@ -40,3 +40,10 @@ withDb' dbPath f = do
else do
g <- postgresNix
Right <$> withGargoyle g dbPath f

-- | Like 'withDb'' but only connects to an existing PostgreSQL database
-- at the given 'FilePath'.
withDbPath :: FilePath -> (ByteString -> IO a) -> IO a
withDbPath dbPath f = do
g <- postgresNix
withGargoyle g dbPath f