An open API service indexing awesome lists of open source software.

https://github.com/khaledalam/redis-cli-key-values-hints

Doc of my PR: https://github.com/redis/redis/pull/12215
https://github.com/khaledalam/redis-cli-key-values-hints

c cli make makefile redis redis-database

Last synced: about 1 year ago
JSON representation

Doc of my PR: https://github.com/redis/redis/pull/12215

Awesome Lists containing this project

README

          

## redis-cli key values hints

```c
/* Add the actual keys' values hint instead of only hint word "key" for GET command.
*
* This method depends on:
* 1) The hint value to be "key"
* 2) SCAN command(since: v2.8.0) with pattern[PREFIX*]
*
* By default hints_keys_values is OFF.
* The default hints_keys_values_count is 5 keys.
*/
```

-------------------------------------------------------------

### [The PR HERE](https://github.com/redis/redis/pull/12215)

Here is a screencast demo:

https://github.com/khaledalam/redis-cli-key-values-hints/assets/8682067/89aba5ae-0784-4a3e-ac80-ed3e36e46499

It's like chating with server while typing before hit Enter but it works like that only if:
- User allow that by adding `:set hints-keys-values` in CLI preferences `~/.redisclirc` file (i just changed the default value of this mechanism to be OFF)
- GET command is used
- Original hint value is the word `key`

### Example:
if we have stored pairs values like this:

_MSET a test1 aa test2 aab test3 aaz test4 abc test5 aah test6 baa test7 bab test8 bbb test9 bbz test10_

```
[
"a": "test1",
"aa": "test2",
"aab": "test3",
"aaz": "test4",
"abc": "test5",
"aah": "test6",
"baa": "test7",
"bab": "test8",
"bbb": "test9",
"bbz": "test10",
]
```

While writing in redis-cli `GET aa` the hint will be like this:

$ GET aa key: [ aa, aah, aaz, aab, ]
redis-key-values-hints1

While writing in redis-cli `GET b` the hint will be like this:

$ GET b key: [ bbb, bba, bab, bbz, ]
redis-key-values-hints2

While writing in redis-cli `GET ba` the hint will be like this:

$ GET ba key: [ baa, bab, ]
redis-key-values-hints3
## User preferences

- Added the ability of setting the actual key' values hint ON and OFF using `:set hints_keys_values` in `~/.redisclirc` file. (by default it's OFF)
- Added the ability of setting number of actual key' values items count (default: 5, max: 20) using `:set hints_keys_values_count X` in `~/.redisclirc` file.