Safe Haskell | None |
---|---|
Language | Haskell2010 |
Gargoyle.PostgreSQL.Connect
Synopsis
- withDb :: String -> (Pool Connection -> IO a) -> IO a
- withDb' :: String -> (ByteString -> IO a) -> IO (Either String a)
- openDb :: ByteString -> IO (Pool Connection)
Documentation
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
.