summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitsutoshiAoe <>2019-05-03 07:19:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-05-03 07:19:00 (GMT)
commit77f8269f6a9583ffbd93074a17817d5a167f8eb9 (patch)
tree0207cd2edc3b4250084b3ea0c08be261ce02d248
parente67700872ad18b7bdcbdd68f1cd2ee4cc5c4942b (diff)
version 1.7.01.7.0
-rwxr-xr-xCHANGELOG.md32
-rw-r--r--influxdb.cabal12
-rw-r--r--src/Database/InfluxDB/JSON.hs11
-rw-r--r--src/Database/InfluxDB/Query.hs2
-rw-r--r--src/Database/InfluxDB/Types.hs1
5 files changed, 32 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2348d50..fbc0345 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Revision history for influxdb
+## v1.7.0 - 2019-05-03
+
+* Support GHC 8.8.1-alpha1
+ * The types of `getField` and `getTag` have changed
+* Relax upper version bounds for clock and network
+
## v1.6.1.3 - 2019-03-26
* Drop unused dependency on QuickCheck
@@ -94,7 +100,7 @@ The first item is a breaking change.
* Relax upper version bound for base ([#51](https://github.com/maoe/influxdb-haskell/pull/51))
* Implement proper escaping and quoting for special characters ([#51](https://github.com/maoe/influxdb-haskell/pull/51), [#52](https://github.com/maoe/influxdb-haskell/pull/52))
- * Introduce the Measurement type and accompanying functions
+ * Introduce the Measurement type and accompanying functions
* Fix a bug in the HTTP writer where the precision parameter is ignored when constructing requests
* Some minor doctest fixes
@@ -127,8 +133,8 @@ and a lot of Haddock comments are added extensively.
* The `FieldVal` has been renamed to `Field` which takes `Nullability` as a type parameter.
* `localServer` has been renamed to `defaultServer`
* Some constructors in `InfluxException` have been renamed
- * `BadRequest` to `ClientError`
- * `IllformedJSON` to `UnexpectedResponse`
+ * `BadRequest` to `ClientError`
+ * `IllformedJSON` to `UnexpectedResponse`
* Added a smart constructor `credentials` for `Credentials`
* Dropped `parseTimestamp` and added `parseUTCTime`
* `ping` handles timeout proerply and throws `InfluxException` on failure
@@ -189,7 +195,7 @@ The library was completely rewritten and support for older InfluxDB has been dro
* Add `writeSeriesData`
* Relax upper version bound for exceptions
* Drop support for old retry package
- * retry < 0.6 had an unexpected behavior wrt exception masking state (https://github.com/Soostone/retry/pull/12)
+ * retry < 0.6 had an unexpected behavior wrt exception masking state (https://github.com/Soostone/retry/pull/12)
## v0.9.0.1 - 2015-01-06
@@ -204,7 +210,7 @@ The library was completely rewritten and support for older InfluxDB has been dro
## v0.8.0 - 2014-11-07
* Retry on connection failure and response timeout in addition to IOException
- * Note that this may break existing code silently
+ * Note that this may break existing code silently
## v0.7.1.1 - 2014-09-19
@@ -218,15 +224,15 @@ The library was completely rewritten and support for older InfluxDB has been dro
## v0.7.0 - 2014-09-12
* Support for influxdb v0.8 (#15)
- * Add shard spaces API
- * Add `configureDatabase`
+ * Add shard spaces API
+ * Add `configureDatabase`
* Add Typeable and Generic instances where missing
* Remove unused `ScheduledDelete` type
## v0.6.0 - 2014-08-19
* Support for retry-0.5 (#16)
- * `newServerPoolWithRetrySettings` has been renamed to `newServerPoolWithRetryPolicy`
+ * `newServerPoolWithRetrySettings` has been renamed to `newServerPoolWithRetryPolicy`
* `serverRetrySettings` field in `ServerPool` has been renamed to `serverRetryPolicy`
* Support for network-uri (#17)
@@ -238,9 +244,9 @@ The library was completely rewritten and support for older InfluxDB has been dro
* Add `InfluxException` type and use it when decoding JSON or SeriesData (#12)
* New API
- * `ping`
- * `listInterfaces`
- * `isInSync`
+ * `ping`
+ * `listInterfaces`
+ * `isInSync`
* BUGFIX: Fix `when expecting a Float, encountered Int instead` error (#14)
## v0.4.2 - 2014-06-06
@@ -262,8 +268,8 @@ The library was completely rewritten and support for older InfluxDB has been dro
## v0.3.0 - 2014-06-03
* Support for InfluxDB v0.7
- * Renamed `username` field for `/cluster_admins` to `user`
- * No support for the old field name
+ * Renamed `username` field for `/cluster_admins` to `user`
+ * No support for the old field name
## v0.2.2 - 2014-05-08
diff --git a/influxdb.cabal b/influxdb.cabal
index 98c50a7..9662f14 100644
--- a/influxdb.cabal
+++ b/influxdb.cabal
@@ -1,5 +1,5 @@
name: influxdb
-version: 1.6.1.3
+version: 1.7.0
synopsis: Haskell client library for InfluxDB
description:
@influxdb@ is a Haskell client library for InfluxDB.
@@ -15,11 +15,11 @@ category: Database
build-type: Custom
cabal-version: 1.24
tested-with:
- GHC == 7.10.3
GHC == 8.0.2
GHC == 8.2.2
GHC == 8.4.4
- GHC == 8.6.4
+ GHC == 8.6.5
+ GHC == 8.8.1
extra-source-files:
README.md
@@ -73,17 +73,17 @@ library
ViewPatterns
ghc-options: -Wall
build-depends:
- base >= 4.8 && < 4.13
+ base >= 4.9 && < 4.14
, aeson >= 0.7 && < 1.5
, attoparsec < 0.14
, bytestring >= 0.10 && < 0.11
- , clock >= 0.7 && < 0.8
+ , clock >= 0.7 && < 0.9
, containers >= 0.5 && < 0.7
, foldl < 1.5
, http-client >= 0.5 && < 0.7
, http-types >= 0.8.6 && < 0.13
, lens >= 4.9 && < 4.18
- , network >= 2.6 && < 3.1
+ , network >= 2.6 && < 3.2
, optional-args >= 1.0 && < 1.1
, scientific >= 0.3.3 && < 0.4
, tagged >= 0.1 && < 0.9
diff --git a/src/Database/InfluxDB/JSON.hs b/src/Database/InfluxDB/JSON.hs
index 54bc758..06eb411 100644
--- a/src/Database/InfluxDB/JSON.hs
+++ b/src/Database/InfluxDB/JSON.hs
@@ -34,6 +34,7 @@ module Database.InfluxDB.JSON
import Control.Applicative
import Control.Exception
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Data.Maybe
import Data.Aeson
@@ -122,26 +123,26 @@ lenientDecoder = Decoder
-- | Get a field value from a column name
getField
- :: Monad m
+ :: Fail.MonadFail m
=> Text -- ^ Column name
-> Vector Text -- ^ Columns
-> Vector Value -- ^ Field values
-> m Value
getField column columns fields =
case V.elemIndex column columns of
- Nothing -> fail $ "getField: no such column " ++ show column
+ Nothing -> Fail.fail $ "getField: no such column " ++ show column
Just idx -> case V.indexM fields idx of
- Nothing -> fail $ "getField: index out of bound for " ++ show column
+ Nothing -> Fail.fail $ "getField: index out of bound for " ++ show column
Just field -> return field
-- | Get a tag value from a tag name
getTag
- :: Monad m
+ :: Fail.MonadFail m
=> Text -- ^ Tag name
-> HashMap Text Value -- ^ Tags
-> m Value
getTag tag tags = case HashMap.lookup tag tags of
- Nothing -> fail $ "getTag: no such tag " ++ show tag
+ Nothing -> Fail.fail $ "getTag: no such tag " ++ show tag
Just val -> return val
-- | Parse a result response.
diff --git a/src/Database/InfluxDB/Query.hs b/src/Database/InfluxDB/Query.hs
index 988012b..38d4dee 100644
--- a/src/Database/InfluxDB/Query.hs
+++ b/src/Database/InfluxDB/Query.hs
@@ -444,7 +444,7 @@ queryRequest QueryParams {..} = applyBasicAuth $ HC.defaultRequest
applyBasicAuth =
case queryAuthentication of
Nothing -> id
- Just (Credentials {..}) ->
+ Just Credentials {..} ->
HC.applyBasicAuth (TE.encodeUtf8 _user) (TE.encodeUtf8 _password)
errorQuery :: String -> HC.Request -> HC.Response body -> A.Value -> IO a
diff --git a/src/Database/InfluxDB/Types.hs b/src/Database/InfluxDB/Types.hs
index 52b3330..589a41e 100644
--- a/src/Database/InfluxDB/Types.hs
+++ b/src/Database/InfluxDB/Types.hs
@@ -7,7 +7,6 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}