Skip to content

feat: add missing HFE (Hash Field Expiration) command types to RedisCommander#61

Open
kkonaparthi1 wants to merge 1 commit into
valkey-io:mainfrom
kkonaparthi1:add-hfe-commands
Open

feat: add missing HFE (Hash Field Expiration) command types to RedisCommander#61
kkonaparthi1 wants to merge 1 commit into
valkey-io:mainfrom
kkonaparthi1:add-hfe-commands

Conversation

@kkonaparthi1
Copy link
Copy Markdown

Fixes #57

Summary

Add type definitions for Valkey 8+ hash field expiration (HFE) commands that are missing from the RedisCommander interface.

Commands Added

  • hexpire — Set expiration in seconds for hash fields
  • hpexpire — Set expiration in milliseconds for hash fields
  • hexpireat — Set expiration as Unix timestamp (seconds)
  • hpexpireat — Set expiration as Unix timestamp (milliseconds)
  • httl — Get remaining TTL in seconds for hash fields
  • hpttl — Get remaining TTL in milliseconds for hash fields
  • hpersist — Remove expiration from hash fields
  • hexpiretime — Get expiration as Unix timestamp (seconds)
  • hpexpiretime — Get expiration as Unix timestamp (milliseconds)

Problem

These commands exist on the Valkey class at runtime but are missing from the RedisCommander TypeScript interface. This prevents TypeScript users from calling them through pipelines and getting type checking.

Approach

Added method signatures following the existing patterns in RedisCommander.ts for similar commands (expire, pexpire, etc.). Includes all NX/XX/GT/LT condition variants for the expiration-setting commands.

…ommander

Add type definitions for Valkey 8+ hash field expiration commands
that are missing from the RedisCommander interface:

- hexpire: Set expiration in seconds for hash fields
- hpexpire: Set expiration in milliseconds for hash fields
- hexpireat: Set expiration as Unix timestamp (seconds) for hash fields
- hpexpireat: Set expiration as Unix timestamp (milliseconds) for hash fields
- httl: Get remaining TTL in seconds for hash fields
- hpttl: Get remaining TTL in milliseconds for hash fields
- hpersist: Remove expiration from hash fields
- hexpiretime: Get expiration as Unix timestamp (seconds) for hash fields
- hpexpiretime: Get expiration as Unix timestamp (milliseconds) for hash fields

These commands exist on the Valkey class at runtime but were missing
from the TypeScript interface, preventing pipeline usage and type
checking for TypeScript users.

Fixes valkey-io#57

Signed-off-by: Karthik Konaparthi <konapk@amazon.com>
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.

RedisCommander is missing hexpire function

1 participant