No description
Find a file
2025-07-09 19:34:09 +08:00
.circleci Added some basic unit tests, and Circle CI 2017-07-03 22:24:26 +01:00
src Update redis.nim 2024-09-26 18:21:20 +09:00
tests mark readNext() as {.gcsafe.} in order to use w/ threaded mode 2021-09-06 14:33:33 +07:00
.editorconfig Working on async redis implementation. 2017-07-03 12:44:36 +01:00
.gitignore made Redis a Nimble package 2015-06-21 00:24:48 +02:00
copying.txt Adding some more information to the readme 2017-07-03 12:59:31 +01:00
readme.md Add main call to examples. 2019-05-04 12:34:58 +01:00
redis.nimble bump to 0.5.0 2025-07-09 19:33:33 +08:00

redis CircleCI

A redis client for Nim.

Installation

Add the following to your .nimble file:

# Dependencies

requires "redis >= 0.2.0"

Or, to install globally to your Nimble cache run the following command:

nimble install redis

Usage

import redis, asyncdispatch

proc main() {.async.} =
  ## Open a connection to Redis running on localhost on the default port (6379)
  let redisClient = await openAsync()

  ## Set the key `nim_redis:test` to the value `Hello, World`
  await redisClient.setk("nim_redis:test", "Hello, World")

  ## Get the value of the key `nim_redis:test`
  let value = await redisClient.get("nim_redis:test")

  assert(value == "Hello, World")

waitFor main()

There is also a synchronous version of the client, that can be created using the open() procedure rather than openAsync().

License

Copyright (C) 2015, 2017 Dominik Picheta and contributors. All rights reserved.