Skip to content

CMS Feature: Add the INFO command - #116

Open
zmccoy wants to merge 12 commits into
valkey-io:count-min-sketchfrom
zmccoy:count-min-sketch-info
Open

CMS Feature: Add the INFO command #116
zmccoy wants to merge 12 commits into
valkey-io:count-min-sketchfrom
zmccoy:count-min-sketch-info

Conversation

@zmccoy

@zmccoy zmccoy commented Aug 5, 2026

Copy link
Copy Markdown

Branched from: #111

This adds the INFO command to the list of supported commands for CMS.

zmccoy added 12 commits August 4, 2026 10:34
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
…consistent

Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
…r INFO

Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
…tatements

Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Signed-off-by: Zach McCoy <zmccoy@jackhenry.com>
Comment thread src/cms/utils.rs
Ok(obj)
}

pub fn width(&self) -> u64 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With width and depth now being public do we need these getters?

match cms {
Some(cms) => {
let result = vec![
ValkeyValue::SimpleStringStatic("Width"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be fully lower case to maintain compatibility with redis, was looking at example in https://redis.io/docs/latest/commands/cms.info/ for the fields returned

];
Ok(ValkeyValue::Array(result))
}
None => Err(ValkeyError::Str(utils::NOT_FOUND)),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ValkeyError::nonexistent_key() to match the other commands as well

//Function that implements logic to handle the CMS.INFO command.
pub fn cms_info(ctx: &Context, args: Vec<ValkeyString>) -> ValkeyResult {
let args_count = args.len();
if args_count != 2 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that specific info fields are not allowed to be called individually to be got. I wonder if we would want to expand this as it wouldn't break functionality and would make it consistent for the other probabilistic data types as well. Let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants