hasql-0.19.10: A very efficient PostgreSQL driver and a flexible mapping API

Safe HaskellNone



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



data Connection Source

A single connection to the database.

type ConnectionError = Maybe ByteString Source

Possible details of the connection acquistion error.

acquire :: Settings -> IO (Either ConnectionError Connection) Source

Acquire a connection using the provided settings encoded according to the PostgreSQL format.

release :: Connection -> IO () Source

Release the connection.

type Settings = ByteString Source

All settings encoded in a single byte-string according to the PostgreSQL format.

settings :: ByteString -> Word16 -> ByteString -> ByteString -> ByteString -> Settings Source

Encode a host, a port, a user, a password and a database into the PostgreSQL settings byte-string.