module HLRDB.Core
(
get
, liftq
, mget
, set
, set'
, liftqs
, mset
, setex
, incr
, incrby
, decr
, decrby
, getrange
, setrange
, getbit
, setbit
, lrange
, lprepend
, lappend
, lpop
, lrem
, llen
, hgetall
, hget
, hmget
, hset
, hmset
, hdel
, hsetnx
, hscan
, smembers
, sismember
, sadd
, srem
, scard
, srandmember
, srandmemberN
, sscan
, zadd
, zscore
, zupdate
, zbest
, zworst
, zmember
, zrank
, zrevrank
, zrem
, zincrby
, zcard
, zscan
, zrangebyscore
, HLRDB.Core.del
, HLRDB.Core.persist
, HLRDB.Core.expire
, HLRDB.Core.expireat
, Redis
, MonadRedis
, liftRedis
, Cursor
, cursor0
, module HLRDB.Primitives.Aggregate
, module HLRDB.Primitives.Redis
) where
import Data.Time
import Data.Time.Clock.POSIX
import Database.Redis (Redis,MonadRedis,liftRedis,Cursor,cursor0,del,persist,expire,expireat)
import HLRDB.Primitives.Aggregate
import HLRDB.Primitives.Redis
import HLRDB.Internal
import HLRDB.Structures.Basic
import HLRDB.Structures.List
import HLRDB.Structures.HSet
import HLRDB.Structures.Set
import HLRDB.Structures.SSet
del :: (Traversable t , MonadRedis m) => RedisStructure v a b -> t a -> m (ActionPerformed Deletion)
del p =
fmap Deleted
. fixEmpty' (unwrap . Database.Redis.del) (primKey p)
persist :: MonadRedis m => RedisStructure v a b -> a -> m Bool
persist p =
liftRedis . unwrap . Database.Redis.persist . primKey p
expire :: MonadRedis m => RedisStructure v a b -> a -> Integer -> m Bool
expire p k =
liftRedis . unwrap . Database.Redis.expire (primKey p k)
expireat :: MonadRedis m => RedisStructure v a b -> a -> UTCTime -> m Bool
expireat p k =
liftRedis
. unwrap
. Database.Redis.expireat (primKey p k)
. round
. utcTimeToPOSIXSeconds