hpqtypes-1.12.0.0: Haskell bindings to libpqtypes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Fold

Synopsis

Documentation

queryResult :: (HasCallStack, MonadDB m, MonadThrow m, FromRow row) => m (QueryResult row) Source #

Get current QueryResult or throw an exception if there isn't one.

foldrDB :: (HasCallStack, MonadDB m, FromRow row) => (row -> acc -> m acc) -> acc -> m acc Source #

Fetcher of rows returned by a query as a monadic right fold.

foldlDB :: (HasCallStack, MonadDB m, FromRow row) => (acc -> row -> m acc) -> acc -> m acc Source #

Fetcher of rows returned by a query as a monadic left fold.

mapDB_ :: (HasCallStack, MonadDB m, FromRow row) => (row -> m r) -> m () Source #

Fetcher of rows returned by a query as a monadic map.

fetchMany :: (HasCallStack, MonadDB m, FromRow row) => (row -> t) -> m [t] Source #

Specialization of foldrDB that fetches a list of rows.

fetchMaybe :: (HasCallStack, MonadDB m, MonadThrow m, FromRow row) => (row -> t) -> m (Maybe t) Source #

Specialization of foldlDB that fetches one or zero rows. If more rows are delivered, AffectedRowsMismatch exception is thrown.

fetchOne :: (HasCallStack, MonadDB m, MonadThrow m, FromRow row) => (row -> t) -> m t Source #

Specialization of fetchMaybe that fetches exactly one row. If no row is delivered, AffectedRowsMismatch exception is thrown.