hasql-1.10.3: Fast PostgreSQL driver with a flexible mapping API
Safe HaskellNone
LanguageHaskell2010

Hasql.Connection

Description

This module provides a low-level effectful API dealing with the connections to the database.

Synopsis

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.