Commands functions in the Redis DuckDB extension
Function category
Commands
1 functionredis_command runs any Redis command given as a VARCHAR[] — for sets, sorted sets, counters and everything else without a dedicated function.
Signature
redis_command(args: VARCHAR[], secret_name: VARCHAR) → VARCHAR
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
args
|
Type
VARCHAR[]
|
Mode Positional | Description |
Argument
secret_name
|
Type
VARCHAR
|
Mode Positional | Description |
Description
Run any Redis command, given as a VARCHAR[] of the command name and its arguments — sets, sorted sets, counters, streams and anything else without a dedicated function. Strings and integers come back as text, nil as NULL, and array replies (also RESP3 maps and sets, flattened) as JSON arrays. Error replies raise an error. The connection is closed afterwards instead of being pooled, since the command may change its state (SELECT, CLIENT, SUBSCRIBE). DuckDB 2.0 build.
1
Example 1
SELECT redis_command(['SADD', 'myset', 'a'], 'my_redis_secret');
2
Example 2
SELECT redis_command(['SMEMBERS', 'myset'], 'my_redis_secret')::JSON;
3
Example 3
SELECT redis_command(['INCRBY', 'counter', '5'], 'my_redis_secret')::BIGINT;