No description
Find a file
Parker Shankin-Clarke 28f4ddac37
Merge pull request #2 from pshankinclarke/tests-regressions
add tests for issue #34 and flush pipeline
2025-12-15 15:46:23 -08:00
.circleci Added some basic unit tests, and Circle CI 2017-07-03 22:24:26 +01:00
src fix async deadlock 2025-12-15 12:42:25 -08:00
tests add tests for issue #34 and flush pipeline 2025-12-15 15:34:23 -08: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 fix formatting in copying.txt 2025-12-12 17:10:14 -08:00
readme.md update install instructions and license 2025-12-12 11:48:25 -08:00
valkey.nimble set version floor and contact email 2025-12-11 18:32:54 -08:00

Valkey

A Valkey client for Nim.

Installation

Add the following to your .nimble file:

# Dependencies

requires "valkey >= 0.1.0"

Or, to install globally:

nimble install valkey

Usage

import valkey, asyncdispatch

proc main() {.async.} =
  ## Open a connection to Valkey running on localhost on the default port (6379)
  let valkeyClient = await connectValkeyAsync()

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

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

  assert(value == "Hello, World")

waitFor main()

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

License

Released under the MIT License, the same license as nim-lang/redis when this project was forked.