Swiftpack.co - Package - vapor/redis
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.


Documentation Team Chat MIT License Continuous Integration Swift 5.0

This project is based off the Redis driver RediStack. For the majority of API documentation, refer to docs.redistack.info.


Stars: 435


Redis 4.0.0 - 2020-12-09T07:14:36

Change Sessions driver to be generic - 2020-12-09T07:11:58

This patch was co-authored by @Mordil and @gwynne and released by @Mordil.

This changes the RedisSessionsDriver to be generic over the RedisSessionsDelegate to drop the performance overhead of the delegate existential.

In general, no one should see a breaking change unless you were passing a RedisSessionsDelegate as an existential - as you will see the "RedisSessionsDelegate cannot be passed to a generic context" message

Change semantics of Redis sessions with key and ID generation - 2020-11-27T23:21:42

This patch was authored and released by @Mordil.

This addresses some semantic issues with the original implementation of SessionDriver for Redis in #175.

Two important changes were made to RedisSessionsDelegate:

  1. makeNewID does not prefix the ID with vrs- anymore
  2. A new makeKey(for:) optional method has been added to the protocol to convert an ID to a RediStack.RedisKey to customize how the id is represented as a key.
    • The default implementation adds the vrs- prefix.

In addition, the protocol has seen two quality of life (breaking) changes to the required protocol methods:

  1. Their argument labels have been updated to read a bit nicer at call sites, and the RedisKey is now passed instead of a SessionID
    • redis(_:storeData:forID:) -> redis(_:store:with:)
    • redis(_:fetchDataForID:) -> redis(_:fetchDataFor:)
  2. They have been marked @inlinable in the protocol definition. To take advantage of potential inlining, make sure you also mark your conformances with @inlinable.

Add Redis driver for Sessions - 2020-11-23T17:54:59

This patch was authored and released by @Mordil.

This resolves issue #162

Redis 4.0.0 Release Candidate 1 - 2020-11-22T22:24:20


  • The validation errors thrown are now of type RedisConnection.Configuration.ValidationError instead of RedisError


  • A database index can be provided in the configuration that all connections will send as a SELECT command when first being created
  • get(_:asJSON:) and set(_:toJSON:) have been added back
  • RediStack 1.1.0 is now required to use the package.

Redis 4.0.0 Beta 6.4 - 2020-10-20T02:49:22


  • Rely on RediStack 1.0.0 full release instead of RC #172


  • Fix parsing the database index by using lastPathComponent to remove trailing / #170
Thanks to @gustavoggs for the changes!

Use Vapor 4.0.0 instead of 4.0.0-beta in Package - 2020-10-19T18:37:31

This patch was authored by @gustavoggs and released by @Mordil.

Rely on Vapor 4.0.0 release rather than beta version

add config option for connection retry timeout - 2020-10-07T03:32:33

This patch was authored and released by @Mordil.

Add support for changing the connection retry timeout from the default of "immediately" to any NIO.TimeAmount (#169)

This is configurable on the RedisConfiguration.pool property:

// wait 5 seconds while the pool tries to find an available connection before failing commands
app.redis.configuration?.pool.connectionRetryTimeout = .seconds(5)

Update to RediStack 1.0.0 Beta 2 - 2020-09-30T06:43:33

This patch was authored and released by @Mordil.

Update to RediStack 1.0.0 Beta 2 to gain PubSub support

Remove RedisKit dep, use RedisStack pooling directly - 2020-09-30T06:13:25

This patch was authored by @tanner0101 and released by @Mordil.

Updates this package to use RediStack directly since it now includes a connection pool (#166).

Update to latest RedisKit and Swift 5.2 - 2020-03-12T18:32:05

This patch was authored and released by @Mordil.

Updates to latest RedisKit beta (#161)

Beta 4 - 2020-02-27T11:17:59

  • Match Vapor's new minimum OS requirement
  • Bump minimum required versions of dependencies
  • Major beta server due to compatibility break of new minimum OS requirement. There are no actual changes to Redis itself.

This patch was authored and released by @gwynne.

RedisStack Alpha 7 updates - 2019-12-14T04:07:00

Updates to RedisStack 1.0.0 Alpha 7 with support for Logger passing (#157)

Redis 4.0.0 Beta 2 - 2019-12-13T02:14:02

  • Updates to latest Vapor 4 beta 2
import Redis
import Vapor

app.redis.configuration = .init(...)

app.get(...) { req in

Redis 3.4.0 - 2019-08-04T20:56:46


  • Concurrent commands should now be able to be sent on the same RedisClient (#149)

Redis 4.0.0 Alpha 1 - 2019-06-24T18:57:52

Redis 3.3.1 - 2019-05-08T16:39:36



Redis 3.3.0 - 2019-03-02T01:57:53


  • Added convenience methods for LPOP, BLPOP, BRPOP, and BRPOPLPUSH. (#138)
  • Added convenience methods for ZADD, ZCOUNT, ZRANGE, ZRANGEBYSCORE, and ZREM (#138)

Redis 3.2.0 - 2019-02-26T19:06:40


  • Added helpers for hash operations HSET, HKEYS, HGET, HDEL, and HGETALL. (#125)

Redis 3.1.0 - 2019-02-07T20:59:57


  • Adds Array conformance to RedisDataConvertible. (#130)
  • Adds string support to Int conformance to RedisDataConvertible. (#131)
  • Adds convenience methods for set operations. (#129)

Redis 3.0.3 - 2019-01-24T00:49:26


  • Fixed a duplicate message warning. (#134)

Redis 3.0.2 - 2018-09-17T14:56:17


  • Added support for parsing null arrays. (#123)

Redis 3.0.1 - 2018-08-28T06:07:32


  • The EXPIRE command now works as expected. (#122)

Redis 3.0.0 - 2018-08-17T20:22:25

Redis 3.0 is here 🎉 ⚡️Non-blocking, event-driven Redis client.

Docs: https://docs.vapor.codes/3.0/redis/getting-started/

API Docs: https://api.vapor.codes/redis/latest/Redis

3.0.0-rc.5 - 2018-07-31T04:00:21

Bumped Vapor/Core to non-RC version to alleviate compatibility issues.

Redis 3.0.0 RC 4 - 2018-07-26T17:35:25


  • Added new select(...) command and config option for choosing a database (#115).
  • Added new expire(_:after:) command (#117).
  • RedisProvider now adds a default KeyedCache implementation (#116).


  • Fixed a bug handling binary data in set(...) command (#118, #113).

Redis 3.0.0 RC 3 - 2018-06-15T03:57:21


  • Added associated Database type to RedisClient.

Redis 3.0.0 RC 2.6 - 2018-05-07T17:46:22


  • RedisDatabase now conforms to KeyedCacheSupporting (#109).
  • Password auth support added (#108).

Milestone: 3.0.0-rc.2.6

Redis 3.0.0 RC 2.5 - 2018-05-07T17:45:34

3.0.0 RC 2.4 - 2018-04-17T21:47:44

@mandarin6b0 fixed a parsing case he found!