Easy trivial configuration for Redis https://bitbucket.org/s9gf4ult/hedis-config
|Latest on Hackage:||0.0.3|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Just copy this
host: localhost # host name or address port: 6379 # you can specify either port # socket: /run/redis.socket # or unix socket path # service: redis # or service name password: "pass" # if not specified then no password used database: 0 # database number to connect to max-connections: 5 # max connections in pool max-idle-time: 30 # keep connection open for 30 seconds
to your config file, then
import Data.Yaml import Database.Redis.Config main :: IO () main = do conn <- decodeFile "config/redis.yml" >>= \case Nothing -> fail "Could not parse redis.conf" Just conf -> connectRedis conf run conn
Thats all, you already working with Redis connection
Empty password string will be nullified. Redis counts empty
AUTHcommand as error when no password is set.
relaxed upper base version constraints to
First working version