From b84283eb33a4c7f4ef3c7a3f52af378272d53e63 Mon Sep 17 00:00:00 2001 From: Menno de Boer Date: Mon, 7 Aug 2023 10:23:35 +0200 Subject: [PATCH] added zRange --- src/Database/Redis/Schema.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Database/Redis/Schema.hs b/src/Database/Redis/Schema.hs index 60b0e6b..ff07a26 100644 --- a/src/Database/Redis/Schema.hs +++ b/src/Database/Redis/Schema.hs @@ -56,7 +56,7 @@ module Database.Redis.Schema , day, hour, minute, second , throw, throwMsg , sInsert, sDelete, sContains, sSize - , Priority(..), zInsert, zSize, zCount, zDelete, zIncrBy, zPopMin, bzPopMin, zRangeByScoreLimit, zRevRange, zScanOpts, zUnionStoreWeights + , Priority(..), zInsert, zSize, zCount, zDelete, zIncrBy, zPopMin, bzPopMin, zRangeByScoreLimit, zRange, zRevRange, zScanOpts, zUnionStoreWeights , txSInsert, txSDelete, txSContains, txSSize , MapItem(..) , RecordField(..), RecordItem(..), Record @@ -1065,6 +1065,13 @@ zRangeByScoreLimit (toIdentifier -> keyBS) (Priority minV) (Priority maxV) offse >>= expectRight "zrangebyscoreLimit call" >>= expectRight "zrangebyscoreLimit decode" . fromBSMany +zRange :: forall ref a. (Ref ref, ValueType ref ~ [(Priority, a)], Serializable a) + => ref -> Integer -> Integer -> RedisM (RefInstance ref) [a] +zRange (toIdentifier -> keyBS) start end = + Hedis.zrange keyBS start end + >>= expectRight "zrange call" + >>= expectRight "zrange decode" . fromBSMany + zRevRange :: forall ref a. (Ref ref, ValueType ref ~ [(Priority, a)], Serializable a) => ref -> Integer -> Integer -> RedisM (RefInstance ref) [a] zRevRange (toIdentifier -> keyBS) start end =