hlrdb 0.4.0.0 → 0.5.0.0
raw patch · 3 files changed
+9/−71 lines, 3 filesdep +cryptohash-md5dep −cryptonitedep −memorydep ~randomPVP ok
version bump matches the API change (PVP)
Dependencies added: cryptohash-md5
Dependencies removed: cryptonite, memory
Dependency ranges changed: random
API changes (from Hackage documentation)
- HLRDB: declareGlobalBasic :: Store v => PathName -> RedisBasic () (Maybe v)
- HLRDB: declareGlobalBasicZero :: Store v => PathName -> v -> RedisBasic () v
- HLRDB: declareGlobalByteString :: PathName -> RedisByteString () ByteString
- HLRDB: declareGlobalHSet :: (Store s, Store v) => PathName -> RedisHSet () s v
- HLRDB: declareGlobalIntegral :: Integral b => PathName -> RedisIntegral () b
- HLRDB: declareGlobalList :: Store v => PathName -> Maybe TrimScheme -> RedisList () v
- HLRDB: declareGlobalSSet :: Store v => PathName -> Maybe TrimScheme -> RedisSSet () v
- HLRDB: declareGlobalSet :: Store v => PathName -> RedisSet () v
- HLRDB: class Store a
+ HLRDB: class () => Store a
Files
- CHANGELOG.md +4/−0
- hlrdb.cabal +3/−4
- src/HLRDB.hs +2/−67
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.5.0.0+- Dropped cryptonite for cryptohash-md5, as the latter is leaner and the former is now deprecated+- Removed global path declarations, as they're vestigial. Any use of `declareGlobal*` should simply be replaced with `declare*`.+ # 0.4.0.0 - Updated hlrdb-core to 0.2.0.0, featuring revamped aggrevation via the @Q@ applicative, which should be more ergonomic than the old profunctor-based API while providing the same guarantees.
hlrdb.cabal view
@@ -1,5 +1,5 @@ name: hlrdb-version: 0.4.0.0+version: 0.5.0.0 synopsis: High-level Redis Database description: A library for type-driven interaction with Redis license: MIT@@ -21,13 +21,12 @@ exposed-modules: HLRDB build-depends: base >= 4.9 && < 5.0- , base64 >= 0.4.2.4 && < 0.5+ , base64 >= 0.4.2.4 && < 1.1 , bytestring- , cryptonite >= 0.24 && < 0.31+ , cryptohash-md5 >= 0.11.101.0 && < 0.12 , hashable , hedis , hlrdb-core >= 0.2 && < 0.3- , memory >= 0.14.8 && < 0.18 , random >= 1.1 && < 1.3 , store >= 0.5.1.1 && < 0.8 , time
src/HLRDB.hs view
@@ -54,15 +54,6 @@ , declareSet , declareHSet , declareSSet- -- * Global path declaration- , declareGlobalBasic- , declareGlobalIntegral- , declareGlobalByteString- , declareGlobalBasicZero- , declareGlobalList- , declareGlobalSet- , declareGlobalHSet- , declareGlobalSSet -- * Other commands , encodePath , foldPath@@ -73,9 +64,8 @@ import qualified Codec.Compression.Zstd as Z import Control.Monad-import qualified Crypto.Hash as H+import qualified Crypto.Hash.MD5 as H import Data.Bits-import qualified Data.ByteArray as H import qualified Data.ByteString import Data.ByteString (ByteString,take,drop,unpack) import qualified Data.ByteString.Base64 as B64@@ -184,8 +174,7 @@ fromString = PathName . Data.ByteString.take 5- . H.convert . H.hashFinalize- . (H.hashUpdate (H.hashInit :: H.Context H.MD5) :: ByteString -> H.Context H.MD5)+ . H.hash . fromString -- | If for some reason you need the actual, raw key name (which you may use with the low-level commands in hedis), you may obtain it via @encodePath@.@@ -296,60 +285,6 @@ declareSSet :: (Store i, Store v) => PathName -> Maybe TrimScheme -> RedisSSet i v declareSSet pathName = RSortedSet $ E (encodePath pathName) (pure . encode) (decode' . runIdentity)---- | A global version of @declareBasic@-{-# INLINE declareGlobalBasic #-}-declareGlobalBasic :: Store v => PathName -> RedisBasic () (Maybe v)-declareGlobalBasic (PathName p) = RKeyValue $ E (const p) (fmap encode) $ \case- Just bs -> case Data.Store.decode bs of- Left _ -> Nothing- Right x -> Just x- Nothing -> Nothing---- | A global version of @declareIntegral@-{-# INLINE declareGlobalIntegral #-}-declareGlobalIntegral :: Integral b => PathName -> RedisIntegral () b-declareGlobalIntegral (PathName p) = RKeyValueInteger (const p) toInteger fromIntegral---- | A global version of @declareByteString@-{-# INLINE declareGlobalByteString #-}-declareGlobalByteString :: PathName -> RedisByteString () ByteString-declareGlobalByteString (PathName p) = RKeyValueByteString (const p)---- | A global version of @declareZero@-{-# INLINE declareGlobalBasicZero #-}-declareGlobalBasicZero :: Store v => PathName -> v -> RedisBasic () v-declareGlobalBasicZero (PathName p) zero = RKeyValue $- E (const p)- (Just . encode)- $ \case- Nothing -> zero- Just bs -> case Data.Store.decode bs of- Left _ -> zero- Right x -> x---- | A global version of @declareList@-{-# INLINE declareGlobalList #-}-declareGlobalList :: Store v => PathName -> Maybe TrimScheme -> RedisList () v-declareGlobalList (PathName p) = RList $ E (const p) (pure . encode) (decode' . runIdentity)---- | A global version of @declareHSet@-{-# INLINE declareGlobalHSet #-}-declareGlobalHSet :: (Store s , Store v) => PathName -> RedisHSet () s v-declareGlobalHSet (PathName p) =- RHSet (E (const p) (pure . encode) (decode' . runIdentity)) (HSET encode decode')---- | A global version of @declareSet@-{-# INLINE declareGlobalSet #-}-declareGlobalSet :: Store v => PathName -> RedisSet () v-declareGlobalSet (PathName p) =- RSet $ E (const p) (pure . encode) (decode' . runIdentity)---- | A global version of @declareSSet@-{-# INLINE declareGlobalSSet #-}-declareGlobalSSet :: Store v => PathName -> Maybe TrimScheme -> RedisSSet () v-declareGlobalSSet (PathName p) =- RSortedSet $ E (const p) (pure . encode) (decode' . runIdentity) scanGlob :: IsIdentifier i => RedisStructure s i v -> ByteString scanGlob = pathGlob . extractPathName