packages feed

antiope-dynamodb 1.0.0 → 3.1.0

raw patch · 4 files changed

+62/−17 lines, 4 filesdep +unliftio-corePVP ok

version bump matches the API change (PVP)

Dependencies added: unliftio-core

API changes (from Hackage documentation)

- Antiope.DynamoDB: class (Functor m, Applicative m, Monad m, MonadIO m, MonadCatch m) => MonadAWS (m :: * -> *)
+ Antiope.DynamoDB.Classy: TableName :: Text -> TableName
+ Antiope.DynamoDB.Classy: class FromText a
+ Antiope.DynamoDB.Classy: class ToText a
+ Antiope.DynamoDB.Classy: dynamoPutItem :: MonadAWS m => TableName -> HashMap Text AttributeValue -> m PutItemResponse
+ Antiope.DynamoDB.Classy: dynamoQuery :: MonadAWS m => TableName -> (Query -> Query) -> m QueryResponse
+ Antiope.DynamoDB.Classy: fromText :: FromText a => Text -> Either String a
+ Antiope.DynamoDB.Classy: newtype TableName
+ Antiope.DynamoDB.Classy: parser :: FromText a => Parser a
+ Antiope.DynamoDB.Classy: toText :: ToText a => a -> Text
- Antiope.DynamoDB: dynamoPutItem :: MonadAWS m => TableName -> HashMap Text AttributeValue -> m PutItemResponse
+ Antiope.DynamoDB: dynamoPutItem :: (MonadUnliftIO m, HasEnv e) => e -> TableName -> HashMap Text AttributeValue -> m PutItemResponse
- Antiope.DynamoDB: dynamoQuery :: MonadAWS m => TableName -> (Query -> Query) -> m QueryResponse
+ Antiope.DynamoDB: dynamoQuery :: (MonadUnliftIO m, HasEnv e) => e -> TableName -> (Query -> Query) -> m QueryResponse

Files

antiope-dynamodb.cabal view
@@ -1,23 +1,22 @@--- This file has been generated from package.yaml by hpack version 0.20.0.+-- This file has been generated from package.yaml by hpack version 0.28.2. -- -- see: https://github.com/sol/hpack ----- hash: f1e6559c39644e3680e089339e947b6df94373115be8c519fe1010be15c5f6b6+-- hash: d6344dfa4d1e0d1bb75a324687e8092b4dee58a3e332717ebfa3b0ac63a64314  name:           antiope-dynamodb-version:        1.0.0+version:        3.1.0 description:    Please see the README on Github at <https://github.com/arbor/antiope#readme> category:       Services homepage:       https://github.com/arbor/antiope#readme bug-reports:    https://github.com/arbor/antiope/issues-author:         Tyler Durden+author:         Arbor Networks maintainer:     mayhem@arbor.net copyright:      Arbor Networks license:        MIT license-file:   LICENSE build-type:     Simple cabal-version:  >= 1.10- extra-source-files:     ChangeLog.md     README.md@@ -39,9 +38,11 @@     , generic-lens     , lens     , text+    , unliftio-core     , unordered-containers   exposed-modules:       Antiope.DynamoDB+      Antiope.DynamoDB.Classy       Antiope.DynamoDB.Types   other-modules:       Paths_antiope_dynamodb@@ -63,6 +64,7 @@     , generic-lens     , lens     , text+    , unliftio-core     , unordered-containers   other-modules:       Paths_antiope_dynamodb
src/Antiope/DynamoDB.hs view
@@ -1,8 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-}  module Antiope.DynamoDB-( MonadAWS-, FromText(..), fromText+( FromText(..), fromText , ToText(..) , TableName(..) , dynamoPutItem@@ -10,16 +9,28 @@ , module Network.AWS.DynamoDB ) where -import Antiope.DynamoDB.Types (TableName (TableName))+import Antiope.DynamoDB.Types  (TableName (TableName)) import Control.Lens-import Data.HashMap.Strict    (HashMap)-import Data.Text              (Text)-import Network.AWS            (MonadAWS, send)-import Network.AWS.Data.Text  (FromText (..), ToText (..), fromText, toText)+import Control.Monad.IO.Unlift (MonadUnliftIO)+import Data.HashMap.Strict     (HashMap)+import Data.Text               (Text)+import Network.AWS             (HasEnv)+import Network.AWS.Data.Text   (FromText (..), ToText (..), fromText, toText) import Network.AWS.DynamoDB -dynamoPutItem :: MonadAWS m => TableName -> HashMap Text AttributeValue -> m PutItemResponse-dynamoPutItem table item = send $ putItem (table & toText) & piItem .~ item+import qualified Network.AWS as AWS -dynamoQuery :: MonadAWS m => TableName -> (Query -> Query) -> m QueryResponse-dynamoQuery table f = send $ f $ query (table & toText)+dynamoPutItem :: (MonadUnliftIO m, HasEnv e)+  => e+  -> TableName+  -> HashMap Text AttributeValue+  -> m PutItemResponse+dynamoPutItem e table item = AWS.runResourceT $ AWS.runAWS e $ AWS.send $ putItem (table & toText) & piItem .~ item++dynamoQuery :: (MonadUnliftIO m, HasEnv e)+  => e+  -> TableName+  -> (Query+  -> Query)+  -> m QueryResponse+dynamoQuery e table f = AWS.runResourceT $ AWS.runAWS e $ AWS.send $ f $ query (table & toText)
+ src/Antiope/DynamoDB/Classy.hs view
@@ -0,0 +1,33 @@+{-# LANGUAGE ScopedTypeVariables #-}++module Antiope.DynamoDB.Classy+( FromText(..), fromText+, ToText(..)+, TableName(..)+, dynamoPutItem+, dynamoQuery+, module Network.AWS.DynamoDB+) where++import Antiope.DynamoDB.Types (TableName (TableName))+import Control.Lens+import Data.HashMap.Strict    (HashMap)+import Data.Text              (Text)+import Network.AWS            (MonadAWS)+import Network.AWS.Data.Text  (FromText (..), ToText (..), fromText, toText)+import Network.AWS.DynamoDB++import qualified Network.AWS as AWS++dynamoPutItem :: MonadAWS m+  => TableName+  -> HashMap Text AttributeValue+  -> m PutItemResponse+dynamoPutItem table item = AWS.send $ putItem (table & toText) & piItem .~ item++dynamoQuery :: MonadAWS m+  => TableName+  -> (Query+  -> Query)+  -> m QueryResponse+dynamoQuery table f = AWS.send $ f $ query (table & toText)
src/Antiope/DynamoDB/Types.hs view
@@ -9,4 +9,3 @@  newtype TableName = TableName Text   deriving (Eq, Show, IsString, ToText, FromText, Generic)-