Escape-hatch interface for adopters not using the official redis client (node-redis v4/v5) — e.g., ioredis, Upstash, a test double.
redis
ioredis
Mirrors the four methods this backend actually calls. All writes use Lua so ownership checks and absolute retention updates stay atomic.
import Redis from 'ioredis';const ioredis = new Redis(process.env.REDIS_URL!);const client: RedisLikeClient = { get: (k) => ioredis.get(k), del: (k) => ioredis.del(k as string), eval: (script, { keys, arguments: args }) => ioredis.eval(script, keys.length, ...keys, ...args), ping: () => ioredis.ping(),}; Copy
import Redis from 'ioredis';const ioredis = new Redis(process.env.REDIS_URL!);const client: RedisLikeClient = { get: (k) => ioredis.get(k), del: (k) => ioredis.del(k as string), eval: (script, { keys, arguments: args }) => ioredis.eval(script, keys.length, ...keys, ...args), ping: () => ioredis.ping(),};
Escape-hatch interface for adopters not using the official
redisclient (node-redis v4/v5) — e.g.,ioredis, Upstash, a test double.Mirrors the four methods this backend actually calls. All writes use Lua so ownership checks and absolute retention updates stay atomic.
Example: ioredis adapter