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
- Host: GitHub
- URL: https://github.com/khaledalam/redis-cli-key-values-hints
- Owner: khaledalam
- Created: 2023-05-23T03:51:22.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T04:03:23.000Z (almost 3 years ago)
- Last Synced: 2025-02-10T07:27:45.367Z (over 1 year ago)
- Topics: c, cli, make, makefile, redis, redis-database
- Homepage:
- Size: 2.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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, ]

While writing in redis-cli `GET b` the hint will be like this:
$ GET b key: [ bbb, bba, bab, bbz, ]

While writing in redis-cli `GET ba` the hint will be like this:
$ GET ba key: [ baa, bab, ]
## 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.