https://github.com/daurnimator/lredis
A redis client for lua
https://github.com/daurnimator/lredis
Last synced: 8 months ago
JSON representation
A redis client for lua
- Host: GitHub
- URL: https://github.com/daurnimator/lredis
- Owner: daurnimator
- License: mit
- Created: 2015-09-21T06:39:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T09:42:56.000Z (almost 5 years ago)
- Last Synced: 2025-03-29T02:51:29.086Z (9 months ago)
- Language: Lua
- Size: 23.4 KB
- Stars: 42
- Watchers: 4
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- my-awesome-lua - lredis - a Redis (in-memory data structure store) client library for Lua (Resources / Database drivers)
- awesome-lua - lredis - Asynchronous Redis client with pipelining and Pub/Sub support; based on cqueues. (Resources / Data Stores)
README
# Redis library for Lua
## Features
- Optionally asynchronous
- Compatible with Lua 5.1, 5.2, 5.3 and [LuaJIT](http://luajit.org/)
- [Subscribe (PubSub) mode](http://redis.io/topics/pubsub)
- Automatic pipelining (if you use more than one coroutine)
## Why not **_________**?
- [redis-lua](https://github.com/nrk/redis-lua)?
- Not asynchronous
- Relies on [luasocket](http://www.impa.br/~diego/software/luasocket)
- Architecture doesn't support subscribe mode
- [lluv-redis](https://github.com/moteus/lua-lluv-redis)?
- Requires lluv/libuv
- [lua-resty-redis](https://github.com/openresty/lua-resty-redis)?
- Only works inside of openresty/nginx
- [lua-hiredis](https://github.com/agladysh/lua-hiredis)?
- Not asynchronous
- Relies on hiredis C module
- Architecture doesn't support subscribe mode
- [lua_redis](https://github.com/omrikiei/lua_redis)
- Not asynchronous
- Relies on hiredis C module
- Architecture doesn't support subscribe mode
- [sidereal](https://github.com/silentbicycle/sidereal)?
- Unmaintained
- Asynchronous mode not really composable
- Relies on [luasocket](http://www.impa.br/~diego/software/luasocket)
- [fend-redis](https://github.com/chatid/fend-redis)?
- Unmaintained
- Relies on hiredis C module
- requires ffi
# Status
This project is a work in progress and not ready for production use.
[](https://travis-ci.org/daurnimator/lredis)
[](https://coveralls.io/github/daurnimator/lredis?branch=master)
# Installation
It's recommended to install lredis by using [luarocks](https://luarocks.org/).
This will automatically install run-time lua dependencies for you.
$ luarocks install --server=http://luarocks.org/dev lredis
## Dependencies
- [cqueues](http://25thandclement.com/~william/projects/cqueues.html) >= 20150907
- [fifo](https://github.com/daurnimator/fifo.lua)
### For running tests
- [luacheck](https://github.com/mpeterv/luacheck)
- [busted](http://olivinelabs.com/busted/)
- [luacov](https://keplerproject.github.io/luacov/)
# Development
## Getting started
- Clone the repo:
```
$ git clone https://github.com/daurnimator/lredis.git
$ cd lredis
```
- Install dependencies
```
$ luarocks install --only-deps lredis-scm-0.rockspec
```
- Lint the code (check for common programming errors)
```
$ luacheck .
```
- Run tests and view coverage report ([install tools first](#for-running-tests))
```
$ busted -c
$ luacov && less luacov.report.out
```
- Install your local copy:
```
$ luarocks make lredis-scm-0.rockspec
```