Qore RedisDataProvider Module Reference 1.0
Loading...
Searching...
No Matches

Introduction to the RedisDataProvider Module

The RedisDataProvider module provides a dataproviderintro "data provider" API for Redis servers. It provides connection management and a comprehensive API for all Redis data types and operations.

This module supports:

  • Connection management via RedisConnection
  • Full Redis command set through the data provider API
  • String, Hash, List, Set, Sorted Set, Pub/Sub, Stream, and Transaction operations

Redis Connection

Redis connections can be created using the redis:// or rediss:// (TLS) URL schemes:

Connection URL Format
redis://[username:password\@]host[:port][/db]
rediss://[username:password\@]host[:port][/db]
Examples
  • redis://localhost - connect to localhost on default port 6379
  • redis://localhost:6380 - connect to localhost on port 6380
  • redis://secret@localhost/1 - authenticate with password, select db 1
  • redis://user:secret@localhost/0 - ACL auth with username (Redis 6.0+)
  • rediss://localhost - TLS connection to localhost

Redis Data Provider Factory

The name of the Redis data provider factory is redis.

Redis Data Provider Examples

These examples are with qdp, the command-line interface to the Data Provider API.

Example: Set a String Value
qdp 'redis{url=redis://localhost}/strings/set' key=mykey,value=myvalue
Example: Get a String Value
qdp 'redis{url=redis://localhost}/strings/get' key=mykey
Example: Set Hash Fields
qdp 'redis{url=redis://localhost}/hashes/set' key=myhash,field=name,value=John
Example: Push to a List
qdp 'redis{url=redis://localhost}/lists/push' key=mylist,values='{item1,item2}'

Available Classes

The following classes are provided by this module:

Release Notes

RedisDataProvider v1.0

  • initial release of the module
  • support for all Redis data types: strings, hashes, lists, sets, sorted sets
  • support for pub/sub, streams, and transactions
  • connection provider with redis:// and rediss:// schemes