hlrdb-core-0.1.6.1: High-level Redis Database Core API
Safe HaskellNone
LanguageHaskell2010

HLRDB.Structures.Basic

Description

Basic storage is simply a key-value lookup in Redis.

Synopsis

Documentation

get :: MonadRedis m => RedisStructure (BASIC w) a b -> a -> m b Source #

Simple get command. Works on RedisBasic a b and RedisIntegral a b.

liftq :: RedisStructure (BASIC w) a b -> a b Source #

Construct a query to be used with mget. You may combine many of these together to create complex queries. Use mget to execute the query back in the Redis monad. Works on RedisBasic a b and RedisIntegral a b.

mget :: MonadRedis m => (a b) -> a -> m b Source #

Reify a (⟿) query into the Redis monad via a single mget command.

set :: MonadRedis m => RedisStructure (BASIC w) a b -> a -> b -> m () Source #

Set a value for a given key. Works on RedisBasic a b and RedisIntegral a b.

set' :: MonadRedis m => RedisBasic a (Maybe b) -> a -> b -> m () Source #

Convenient alias for setting a value for an optional path

liftqs :: RedisStructure (BASIC w) a b -> (a, b) -> MSET Source #

Construct a query to be used with mset. The MSET type is a Monoid, so you may combine many of these together before executing the batch with the mset command.

mset :: MonadRedis m => MSET -> m () Source #

Execute a MSET query.

setex :: MonadRedis m => RedisStructure (BASIC w) a b -> a -> Integer -> b -> m () Source #

Set a value together with a given expiration timeout (in seconds).

incr :: MonadRedis m => RedisIntegral a b -> a -> m b Source #

Increment an Integer in Redis. Empty values are treated as 0.

incrby :: MonadRedis m => RedisIntegral a b -> a -> b -> m b Source #

Increment an Integer in Redis by a specific amount. Empty values are treated as 0.

decr :: MonadRedis m => RedisIntegral a b -> a -> m b Source #

Decrement an Integer in Redis. Empty values are treated as 0.

decrby :: MonadRedis m => RedisIntegral a b -> a -> b -> m b Source #

Decrement an Integer in Redis by a specific amount. Empty values are treated as 0.

getrange :: MonadRedis m => RedisByteString a ByteString -> a -> Integer -> Integer -> m ByteString Source #

Start and end indices are inclusive. Unlike get, the empty bytestring is returned if the key does not exist in Redis or if the specified range is out of range.

setrange :: MonadRedis m => RedisByteString a ByteString -> a -> Integer -> ByteString -> m Integer Source #

The Integer paramter is the offset. Returns the length of the string after the command has been executed.

getbit :: MonadRedis m => RedisByteString a ByteString -> a -> Integer -> m Bool Source #

Get the bit stored at the specified offset. Note that if no value exists in Redis or if the specified range is outside the defined range, False will be returned by default.

setbit :: MonadRedis m => RedisByteString a ByteString -> a -> Integer -> Bool -> m Bool Source #

Set the bit at the specified offset. If the offset is outside the existing defined range of the value, 0s are implicitly inserted to fill the intermediate space. Returns the existing value of this bit, as defined by the getbit semantics above.