packages feed

postgresql-simple-named 0.0.1.0 → 0.0.2.0

raw patch · 3 files changed

+20/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ PgNamed: executeNamed_ :: (MonadIO m, WithNamedError m) => Connection -> Query -> [NamedParam] -> m ()

Files

CHANGELOG.md view
@@ -3,6 +3,11 @@ `postgresql-simple-named` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 0.0.2.0 — Sep 10, 2019++* [#21](https://github.com/holmusk/postgresql-simple-named/issues/21):+  Implement `executeNamed_`.+ ## 0.0.1.0 — Jul 23, 2019  * [#16](https://github.com/holmusk/postgresql-simple-named/issues/16):
postgresql-simple-named.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                postgresql-simple-named-version:             0.0.1.0+version:             0.0.2.0 synopsis:            Implementation of named parameters for `postgresql-simple` library description:     Implementation of named parameters for @postgresql-simple@ library.
src/PgNamed.hs view
@@ -38,11 +38,13 @@        , queryNamed        , queryWithNamed        , executeNamed+       , executeNamed_           -- * Internal utils        , withNamedArgs        ) where +import Control.Monad (void) import Control.Monad.Except (MonadError (throwError)) import Control.Monad.IO.Class (MonadIO (liftIO)) import Data.Bifunctor (bimap)@@ -263,6 +265,18 @@ executeNamed conn qNamed params =     withNamedArgs qNamed params >>= \(q, actions) ->         liftIO $ PG.execute conn q (toList actions)++{- | Same as 'executeNamed' but discard the nubmer of rows affected by the given+query. This function is useful when you're not interested in this number.+-}+executeNamed_+    :: (MonadIO m, WithNamedError m)+    => PG.Connection  -- ^ Database connection+    -> PG.Query       -- ^ Query with named parameters inside+    -> [NamedParam]   -- ^ The list of named parameters to be used in the query+    -> m ()+executeNamed_ conn qNamed = void . executeNamed conn qNamed+{-# INLINE executeNamed_ #-}  {- | Helper to use named parameters. Use it to implement named wrappers around functions from @postgresql-simple@ library. If you think that the function is