github nalgeon/redka v0.4.0

latest releases: v0.5.3, v0.5.2, v0.5.1...
6 months ago

Redka aims to reimplement the good parts of Redis with SQLite, while remaining compatible with the Redis API. This release adds support for list commands and improves throughput quite a bit (+20% for writes, +60% for reads).

All commands are available via the Redis wire protocol (RESP) and the Go API.

InstallationUsageRoadmap

Special thanks to @yinzhidong for implementing the PING command.

Lists

Redka supports the following list-related commands:

  • LINDEX - Returns an element from a list by its index.
  • LINSERT - Inserts an element before or after another element in a list.
  • LLEN - Returns the length of a list.
  • LPOP - Returns the first element of a list after removing it.
  • LPUSH - Prepends an element to a list.
  • LRANGE - Returns a range of elements from a list.
  • LREM - Removes elements from a list.
  • LSET - Sets the value of an element in a list by its index.
  • LTRIM - Removes elements from both ends a list.
  • RPOP - Returns the last element of a list after removing it.
  • RPOPLPUSH - Removes the last element and pushes it to another list.
  • RPUSH - Appends an element to a list.

⚠️ Breaking changes

Until Redka reaches 1.0, I may introduce breaking changes with each release. Sorry for that.

rkey.DB / rkey.Tx interface changes:

- Scan(cursor int, pattern string, count int) (ScanResult, error)
+ Scan(cursor int, pattern string, ktype core.TypeID, count int) (ScanResult, error)

- Scanner(pattern string, pageSize int) *Scanner
+ Scanner(pattern string, ktype core.TypeID, pageSize int) *Scanner

There are also some non-backward-compatible database schema changes, and I'd rather not introduce automated migrations until 1.0. If you are already using Redka in production and need a migration, let me know in the issues.

Don't miss a new redka release

NewReleases is sending notifications on new releases.