packages feed

antiope-athena 4.0.1 → 5.0.0

raw patch · 3 files changed

+11/−78 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Antiope.Athena.Classy: query :: MonadAWS m => ResultConfiguration -> QueryExecutionContext -> Text -> Text -> m [Row]
- Antiope.Athena.Classy: queryExecutionSucceed :: MonadAWS m => Text -> m Bool
- Antiope.Athena: query :: (HasEnv e, MonadUnliftIO m) => e -> ResultConfiguration -> QueryExecutionContext -> Text -> Text -> m [Row]
+ Antiope.Athena: query :: MonadAWS m => ResultConfiguration -> QueryExecutionContext -> Text -> Text -> m [Row]
- Antiope.Athena: queryExecutionSucceed :: (MonadUnliftIO m, HasEnv e) => e -> Text -> m Bool
+ Antiope.Athena: queryExecutionSucceed :: MonadAWS m => Text -> m Bool

Files

antiope-athena.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 895f81a361fe7f1462c63169333bebddeac95ae2750b2c8596ffb3fbe3ab68bb+-- hash: 862a9bb27e97f9f2b7bcc67388292301486589db51e7e9b225a7df79d32de4bf  name:           antiope-athena-version:        4.0.1+version:        5.0.0 description:    Please see the README on Github at <https://github.com/arbor/antiope#readme> category:       Services homepage:       https://github.com/arbor/antiope#readme@@ -41,7 +41,6 @@     , unliftio-core   exposed-modules:       Antiope.Athena-      Antiope.Athena.Classy   other-modules:       Paths_antiope_athena   default-language: Haskell2010
src/Antiope/Athena.hs view
@@ -5,22 +5,20 @@   ) where  import Control.Lens-import Control.Monad.IO.Unlift (MonadUnliftIO)-import Data.Text               (Text)-import Network.AWS             (HasEnv, Rs)+import Data.Text          (Text)+import Network.AWS        (MonadAWS, Rs) import Network.AWS.Athena-import Network.AWS.Waiter      hiding (accept)+import Network.AWS.Waiter hiding (accept)  import qualified Network.AWS as AWS -query :: (HasEnv e, MonadUnliftIO m)-  => e-  -> ResultConfiguration+query :: MonadAWS m+  => ResultConfiguration   -> QueryExecutionContext   -> Text   -> Text   -> m [Row]-query e config context qstring clientRequestToken = AWS.runResourceT $ AWS.runAWS e $ do+query config context qstring clientRequestToken = do   resp <- AWS.send $ startQueryExecution qstring config     & sqeQueryExecutionContext  ?~ context     & sqeClientRequestToken     ?~ clientRequestToken@@ -54,11 +52,10 @@     where status :: Fold (Rs GetQueryExecution) QueryExecutionState           status = gqersQueryExecution . _Just . qeStatus . _Just . qesState . _Just -queryExecutionSucceed :: (MonadUnliftIO m, HasEnv e)-  => e-  -> Text+queryExecutionSucceed :: MonadAWS m+  => Text   -> m Bool-queryExecutionSucceed e qeid = AWS.runResourceT $ AWS.runAWS e $ do+queryExecutionSucceed qeid = do   eq <- view gqersQueryExecution <$> AWS.send (getQueryExecution qeid)   case view qesState =<< (view qeStatus =<< eq) of     Just Succeeded -> return True
− src/Antiope/Athena/Classy.hs
@@ -1,63 +0,0 @@-module Antiope.Athena.Classy-  ( query-  , queryExecutionSucceed-  , module Network.AWS.Athena-  ) where--import Control.Lens-import Data.Text          (Text)-import Network.AWS        (MonadAWS, Rs)-import Network.AWS.Athena-import Network.AWS.Waiter hiding (accept)--import qualified Network.AWS as AWS--query :: MonadAWS m-  => ResultConfiguration-  -> QueryExecutionContext-  -> Text-  -> Text-  -> m [Row]-query config context qstring clientRequestToken = do-  resp <- AWS.send $ startQueryExecution qstring config-    & sqeQueryExecutionContext  ?~ context-    & sqeClientRequestToken     ?~ clientRequestToken-  case resp ^. sqersQueryExecutionId of-    Just qeid -> go qeid-    Nothing   -> return []-  where go qeid = do-          accept <- AWS.await queryExecutionFinished (getQueryExecution qeid)-          case accept of-            AcceptSuccess -> do-              results <- AWS.send $ getQueryResults qeid-              case view gqrrsResultSet results of-                Just rs -> return $ view rsRows rs-                Nothing -> return []-            AcceptRetry   -> go qeid-            _             -> return []--queryExecutionFinished :: Wait GetQueryExecution-queryExecutionFinished = Wait-    { _waitName = "QueryFinished"-    , _waitAttempts = 100-    , _waitDelay = 1-    , _waitAcceptors =-      [ matchAll Succeeded AcceptSuccess status-      , matchAll Failed    AcceptFailure status-      , matchAll Cancelled AcceptFailure status-      , matchAll Queued    AcceptRetry   status-      , matchAll Running   AcceptRetry   status-      ]-    }-    where status :: Fold (Rs GetQueryExecution) QueryExecutionState-          status = gqersQueryExecution . _Just . qeStatus . _Just . qesState . _Just--queryExecutionSucceed :: MonadAWS m-  => Text-  -> m Bool-queryExecutionSucceed qeid = do-  eq <- view gqersQueryExecution <$> AWS.send (getQueryExecution qeid)-  case view qesState =<< (view qeStatus =<< eq) of-    Just Succeeded -> return True-    Just _         -> return False-    Nothing        -> return False