Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
man
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

rrlite

Build Status Coverage Status

R interface to rlite. rlite is a "self-contained, serverless, zero-configuration, transactional redis-compatible database engine. rlite is to Redis what SQLite is to SQL. And Redis is a data structures server; at the simplest level it can be used as a key-value store, but it can store other data types (hashes, lists, sets and more).

This package is designed to follow exactly the same interface as redux.

Usage

See redux for more details.

The main function here is rrlite::hirlite that creates a redis_api object that exposes the full Redis API.

con <- rrlite::hirlite()
con
## <redis_api>
##   Redis commands:
##     APPEND: function
##     AUTH: function
##     BGREWRITEAOF: function
##     BGSAVE: function
##     ...
##     ZSCORE: function
##     ZUNIONSTORE: function
##   Other public methods:
##     clone: function
##     command: function
##     config: function
##     initialize: function
##     pipeline: function
##     reconnect: function
##     subscribe: function
##     type: function

This object has all the same methods as the corresponding object created by redux::hiredis() but operating on a rlite database. The default database uses the magic path :memory: but persistent on-disk storage is possible (see ?rlite_config).

All the usual Redis-type things work:

con$SET("mykey", "mydata")
## [Redis: OK]
con$GET("mykey")
## [1] "mydata"

As with redux, commands are vectorised:

con$MSET(c("a", "b", "c"), c(1, 2, 3))
## [Redis: OK]
con$MGET(c("a", "b", "c"))
## [[1]]
## [1] "1"
##
## [[2]]
## [1] "2"
##
## [[3]]
## [1] "3"

Approach

This package aims to be a drop-in self-contained replacement for redux without requiring Redis server. Therefore almost the entire package (and tests) is automaticaly generated from redux. The only installed files not generated are:

  • R/hirlite.R (because documentation)
  • src/subscribe.c (just a stub)

Meta

  • Please report any issues or bugs.
  • License: GPL
  • Get citation information for rrlite in R by doing citation(package = 'rrlite')

rofooter

You can’t perform that action at this time.