| 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
- acquire :: Settings -> IO (Either ConnectionError Connection)
- release :: Connection -> IO ()
- use :: Connection -> Session a -> IO (Either SessionError a)
Documentation
data Connection Source #
A single connection to the database.
acquire :: Settings -> IO (Either ConnectionError Connection) Source #
Establish a connection according to the provided settings.
release :: Connection -> IO () Source #
Release the connection.
use :: Connection -> Session a -> IO (Either SessionError a) Source #
Execute a sequence of operations with exclusive access to the connection.
Blocks until the connection is available when there is another session running upon the connection on a different thread.