hipsql-monad-0.0.0.0
Safe HaskellNone
LanguageHaskell2010

Hipsql.Monad

Description

This module provides a low-dependency integration point for supporting hipsql interop in your own Monad.

In practice, you generally want to define an instance for MonadHipsqlAdapter and use the orphan instance for MonadHipsql provided by importing Adapter from hipsql-server. This way, you can optionally depend on hipsql-server only when you need to but can always depend on hipsql-monad, the latter of which would not cause you to transitively depend on any additional packages.

Synopsis

Documentation

class MonadHipsql m where Source #

Type class for starting a hipsql session in a Monad m.

N.B. You generally do not want to define this instance on your own. See the haddock at the top of this module.

Methods

hipsql :: HasCallStack => m () Source #

Starts a hipsql session in the given Monad m.

class MonadHipsqlAdapter m where Source #

Convenience type class used for deriving instances of MonadHipsql.

See the haddock at the top of this module for an explanation.

Methods

hipsqlAcquireLibPQ :: (Connection -> IO a) -> m a Source #