hpqtypes-1.6.0.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Fold

Synopsis

Documentation

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

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

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

Specialization of foldrM for convenient query results fetching.

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

Specialization of foldlM for convenient query results fetching.

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

Specialization of mapM_ for convenient mapping over query results.

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

Specialization of foldrDB that fetches a list of rows.

fetchMaybe :: (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 :: (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.