summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitsutoshiAoe <>2016-05-17 01:17:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-05-17 01:17:00 (GMT)
commit1a20351ac288260a9c115e807eb0383d27e8b896 (patch)
tree9e28f88725057eb396ac75d81e0b12255742d326
parent3ff61af5debbd0198f17f53c6206cc4f1edf73f8 (diff)
version 0.10.00.10.0
-rw-r--r--CHANGELOG.md7
-rw-r--r--README.md2
-rw-r--r--influxdb.cabal10
-rw-r--r--src/Database/InfluxDB.hs2
-rw-r--r--src/Database/InfluxDB/Encode.hs2
-rw-r--r--src/Database/InfluxDB/Http.hs4
-rw-r--r--src/Database/InfluxDB/TH.hs8
-rw-r--r--src/Database/InfluxDB/Types.hs20
8 files changed, 31 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9465eba..186fa93 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## v0.10.0 - 2016-05-17
+
+* Fix a typo in a Haddock comment (#28)
+* Drop support for retry < 0.7
+* Add stack.yml
+* Add support for GHC 8.0.1 (#29)
+
## v0.9.1.3 - 2015-06-02
* Relax upper bound for aeson
diff --git a/README.md b/README.md
index 8567e30..f8c4097 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@ Haskell client library for InfluxDB
[![Coverage Status](https://coveralls.io/repos/maoe/influxdb-haskell/badge.png?branch=develop)](https://coveralls.io/r/maoe/influxdb-haskell?branch=develop)
[![Gitter chat](https://badges.gitter.im/maoe/influxdb-haskell.png)](https://gitter.im/maoe/influxdb-haskell)
+Support for current version of InfluxDB is under development.
+
Contact information
----------
diff --git a/influxdb.cabal b/influxdb.cabal
index 7c069e8..4a90469 100644
--- a/influxdb.cabal
+++ b/influxdb.cabal
@@ -1,5 +1,5 @@
name: influxdb
-version: 0.9.1.3
+version: 0.10.0
synopsis: Haskell client library for InfluxDB
description: Haskell client library for InfluxDB
homepage: https://github.com/maoe/influxdb-haskell
@@ -61,7 +61,7 @@ library
ViewPatterns
ghc-options: -Wall
build-depends:
- base >= 4 && < 4.9
+ base >= 4 && < 5.0
, attoparsec < 0.14
, bytestring
, containers
@@ -70,7 +70,7 @@ library
, exceptions >= 0.5 && < 0.9
, http-client < 0.5
, mtl < 2.3
- , retry >= 0.6 && < 0.7
+ , retry >= 0.7 && < 0.8
, tagged
, template-haskell
, text < 1.3
@@ -78,7 +78,7 @@ library
if flag(aeson-070)
build-depends:
- aeson >= 0.7.0 && < 0.10
+ aeson >= 0.7.0 && < 0.12
, scientific >= 0.2
else
build-depends:
@@ -142,5 +142,5 @@ source-repository head
source-repository this
type: git
- tag: v0.9.1.3
+ tag: v0.10.0
location: https://github.com/maoe/influxdb-haskell.git
diff --git a/src/Database/InfluxDB.hs b/src/Database/InfluxDB.hs
index 8250833..d3b5836 100644
--- a/src/Database/InfluxDB.hs
+++ b/src/Database/InfluxDB.hs
@@ -24,7 +24,7 @@ module Database.InfluxDB
, TimePrecision(..)
, Server(..), localServer
, ServerPool, newServerPool
- , newServerPoolWithRetryPolicy, newServerPoolWithRetrySettings
+ , newServerPoolWithRetryPolicy
, Database(..)
, User(..)
, Admin(..)
diff --git a/src/Database/InfluxDB/Encode.hs b/src/Database/InfluxDB/Encode.hs
index d812268..6b28c90 100644
--- a/src/Database/InfluxDB/Encode.hs
+++ b/src/Database/InfluxDB/Encode.hs
@@ -28,7 +28,7 @@ class ToSeries a where
-- > data EventType = Login | Logout
-- >
-- > instance ToSeriesData Event where
--- > toSeriesColumn _ = V.fromList ["user", "type"]
+-- > toSeriesColumns _ = V.fromList ["user", "type"]
-- > toSeriesPoints (Event user ty) = V.fromList [toValue user, toValue ty]
-- >
-- > instance ToValue EventType
diff --git a/src/Database/InfluxDB/Http.hs b/src/Database/InfluxDB/Http.hs
index e27c08c..93931e3 100644
--- a/src/Database/InfluxDB/Http.hs
+++ b/src/Database/InfluxDB/Http.hs
@@ -84,7 +84,7 @@ import Text.Printf (printf)
import Prelude
import Control.Monad.Catch (Handler(..))
-import Control.Retry
+import Control.Retry (recovering)
import Data.Aeson ((.=))
import Data.Aeson.TH (deriveToJSON)
import Data.Default.Class (Default(def))
@@ -742,7 +742,7 @@ withPool
-> IO a
withPool pool request f = do
retryPolicy <- serverRetryPolicy <$> readIORef pool
- recovering retryPolicy handlers $ do
+ recovering retryPolicy handlers $ \_ -> do
server <- activeServer pool
f $ makeRequest server
where
diff --git a/src/Database/InfluxDB/TH.hs b/src/Database/InfluxDB/TH.hs
index 06d0f47..ab86e09 100644
--- a/src/Database/InfluxDB/TH.hs
+++ b/src/Database/InfluxDB/TH.hs
@@ -57,14 +57,22 @@ deriveWith
:: (Options -> Name -> [TyVarBndr] -> Con -> Q Dec)
-> Options -> Dec -> Q Dec
deriveWith f opts dec = case dec of
+#if MIN_VERSION_template_haskell(2, 11, 0)
+ DataD _ tyName tyVars _ [con] _ -> f opts tyName tyVars con
+ NewtypeD _ tyName tyVars _ con _ -> f opts tyName tyVars con
+#else
DataD _ tyName tyVars [con] _ -> f opts tyName tyVars con
NewtypeD _ tyName tyVars con _ -> f opts tyName tyVars con
+#endif
_ -> fail $ "Expected a data or newtype declaration, but got " ++ show dec
toSeriesDataBody :: Options -> Name -> [TyVarBndr] -> Con -> Q Dec
toSeriesDataBody opts tyName tyVars con = do
case con of
RecC conName vars -> InstanceD
+#if MIN_VERSION_template_haskell(2, 11, 0)
+ Nothing
+#endif
<$> mapM tyVarToPred tyVars
<*> [t| ToSeriesData $(conT tyName) |]
<*> deriveDecs conName vars
diff --git a/src/Database/InfluxDB/Types.hs b/src/Database/InfluxDB/Types.hs
index 54d2e8e..9a46864 100644
--- a/src/Database/InfluxDB/Types.hs
+++ b/src/Database/InfluxDB/Types.hs
@@ -3,6 +3,7 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Database.InfluxDB.Types
@@ -27,10 +28,8 @@ module Database.InfluxDB.Types
-- * Server pool
, ServerPool
, serverRetryPolicy
- , serverRetrySettings
, newServerPool
, newServerPoolWithRetryPolicy
- , newServerPoolWithRetrySettings
, activeServer
, failover
@@ -54,7 +53,7 @@ import Data.Word (Word32)
import GHC.Generics (Generic)
import qualified Data.Sequence as Seq
-import Control.Retry (RetryPolicy(..), limitRetries, exponentialBackoff)
+import Control.Retry (RetryPolicy, limitRetries, exponentialBackoff)
import Data.Aeson ((.=), (.:))
import Data.Aeson.TH
import qualified Data.Aeson as A
@@ -204,11 +203,7 @@ data ServerPool = ServerPool
, serverBackup :: !(Seq Server)
-- ^ The rest of the servers in the pool.
, serverRetryPolicy :: !RetryPolicy
- } deriving (Typeable, Generic)
-
-{-# DEPRECATED serverRetrySettings "Use serverRetryPolicy instead" #-}
-serverRetrySettings :: ServerPool -> RetryPolicy
-serverRetrySettings = serverRetryPolicy
+ }
newtype Database = Database
{ databaseName :: Text
@@ -247,8 +242,9 @@ data ShardSpace = ShardSpace
-- | Create a non-empty server pool. You must specify at least one server
-- location to create a pool.
newServerPool :: Server -> [Server] -> IO (IORef ServerPool)
-newServerPool = newServerPoolWithRetrySettings defaultRetryPolicy
+newServerPool = newServerPoolWithRetryPolicy defaultRetryPolicy
where
+ defaultRetryPolicy :: RetryPolicy
defaultRetryPolicy = limitRetries 5 <> exponentialBackoff 50
newServerPoolWithRetryPolicy
@@ -260,12 +256,6 @@ newServerPoolWithRetryPolicy retryPolicy active backups =
, serverRetryPolicy = retryPolicy
}
-{-# DEPRECATED newServerPoolWithRetrySettings
- "Use newServerPoolWithRetryPolicy instead" #-}
-newServerPoolWithRetrySettings
- :: RetryPolicy -> Server -> [Server] -> IO (IORef ServerPool)
-newServerPoolWithRetrySettings = newServerPoolWithRetryPolicy
-
-- | Get a server from the pool.
activeServer :: IORef ServerPool -> IO Server
activeServer ref = do