Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- class MonadHipsql m where
- hipsql :: HasCallStack => m ()
- class MonadHipsqlAdapter m where
- hipsqlAcquireLibPQ :: (Connection -> IO a) -> m a
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.
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.
hipsqlAcquireLibPQ :: (Connection -> IO a) -> m a Source #