diff options
| author | LLLL Colonq <llll@colonq> | 2024-11-05 02:59:23 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-11-05 02:59:23 -0500 |
| commit | 4f71b652cf29e4c20e7e33e521371650ed5d27ad (patch) | |
| tree | bc819a3af55a0631cde9746a8d9580bb73547488 /fig-frontend/src/Fig/Frontend/DB.hs | |
| parent | c8e4f88739d52717de9e5faea4e752918e6457b3 (diff) | |
Add sentiment API
Diffstat (limited to 'fig-frontend/src/Fig/Frontend/DB.hs')
| -rw-r--r-- | fig-frontend/src/Fig/Frontend/DB.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
