Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nim-lang/redis
Official redis wrapper for Nim.
https://github.com/nim-lang/redis
Last synced: 10 days ago
JSON representation
Official redis wrapper for Nim.
- Host: GitHub
- URL: https://github.com/nim-lang/redis
- Owner: nim-lang
- License: other
- Created: 2015-06-20T21:39:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-15T07:15:19.000Z (about 2 months ago)
- Last Synced: 2024-09-15T10:29:41.240Z (about 2 months ago)
- Language: Nim
- Size: 127 KB
- Stars: 126
- Watchers: 15
- Forks: 34
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: copying.txt
Awesome Lists containing this project
- web-gelistirme-101 - Redis
- awesome-nim - redis - Official redis wrapper for Nim. (Data / Database)
README
# redis [![CircleCI](https://circleci.com/gh/nim-lang/redis.svg?style=svg)](https://circleci.com/gh/nim-lang/redis)
A redis client for Nim.
## Installation
Add the following to your `.nimble` file:
```
# Dependenciesrequires "redis >= 0.2.0"
```Or, to install globally to your Nimble cache run the following command:
```
nimble install redis
```## Usage
```nim
import redis, asyncdispatchproc 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.