gargoyle-postgresql-connect-0.1.0.3: Connect to gargoyle-managed postgresql instances
Safe HaskellNone
LanguageHaskell2010

Gargoyle.PostgreSQL.Connect

Synopsis

Documentation

withDb :: String -> (Pool Connection -> IO a) -> IO a Source #

Like withDb' but turns the connection string into a connection Pool for you and using error on failure.

withDb' :: String -> (ByteString -> IO a) -> IO (Either String a) Source #

Connects to a database using information at the given filepath. The given filepath can be either a folder (for a local db) or a file with a database connection string.

withDb' takes a String, which represents the path to a database, and a function that returns database connection information as arguments in order to open and start the database. Otherwise, it will create the database for you if it doesn't exist.

openDb :: ByteString -> IO (Pool Connection) Source #

Convert a connection string into a connection Pool.