From 4f71b652cf29e4c20e7e33e521371650ed5d27ad Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 5 Nov 2024 02:59:23 -0500 Subject: Add sentiment API --- fig-frontend/src/Fig/Frontend/DB.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fig-frontend/src/Fig/Frontend/DB.hs') diff --git a/fig-frontend/src/Fig/Frontend/DB.hs b/fig-frontend/src/Fig/Frontend/DB.hs index b0f065d..51da59e 100644 --- a/fig-frontend/src/Fig/Frontend/DB.hs +++ b/fig-frontend/src/Fig/Frontend/DB.hs @@ -17,6 +17,14 @@ get c key = liftIO $ Redis.runRedis c do v <- Redis.get key pure . join $ hush v +incr :: MonadIO m => Redis.Connection -> ByteString -> m () +incr c key = liftIO $ Redis.runRedis c do + void $ Redis.incr key + +decr :: MonadIO m => Redis.Connection -> ByteString -> m () +decr c key = liftIO $ Redis.runRedis c do + void $ Redis.decr key + hget :: MonadIO m => Redis.Connection -> ByteString -> ByteString -> m (Maybe ByteString) hget c key hkey = liftIO $ Redis.runRedis c do v <- Redis.hget key hkey -- cgit v1.2.3