Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hasql.Connection
Description
This module provides a low-level effectful API dealing with the connections to the database.
Synopsis
- data Connection
- type ConnectionError = Maybe ByteString
- acquire :: [Setting] -> IO (Either ConnectionError Connection)
- release :: Connection -> IO ()
- withLibPQConnection :: Connection -> (Connection -> IO a) -> IO a
Documentation
data Connection Source #
A single connection to the database.
Instances
MonadReader Connection Session Source # | |
Defined in Hasql.Session.Core Methods ask :: Session Connection # local :: (Connection -> Connection) -> Session a -> Session a # reader :: (Connection -> a) -> Session a # |
type ConnectionError = Maybe ByteString Source #
Possible details of the connection acquistion error.
acquire :: [Setting] -> IO (Either ConnectionError Connection) Source #
Establish a connection according to the provided settings.
release :: Connection -> IO () Source #
Release the connection.
withLibPQConnection :: Connection -> (Connection -> IO a) -> IO a Source #
Execute an operation on the raw libpq
Connection
.
The access to the connection is exclusive.