Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RENAME command #58

Closed
kelvinmwinuka opened this issue Jun 15, 2024 · 1 comment · Fixed by #81
Closed

Implement RENAME command #58

kelvinmwinuka opened this issue Jun 15, 2024 · 1 comment · Fixed by #81
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kelvinmwinuka
Copy link
Collaborator

kelvinmwinuka commented Jun 15, 2024

Implement the RENAME command, which renames the specified key with the new name.
Reference: https://redis.io/docs/latest/commands/rename/

Client-Server Spec:

Command File: ./internal/modules/generic/commands.go
Test File: ./internal/modules/generic/commands_test.go

Command: rename
Module: constants.GenericModule
Categories: constants.KeyspaceCategory, constants.WriteCategory, constants.SlowCategory
Description: (RENAME key newkey) Renames the specified key with the new provided name.
Sync: true

Embedded Spec:

Command File: ./echovault/api_generic.go
Test File: ./echovault/api_generic_test.go

NOTE: You may have to edit the HandlerFuncParams type to include a function that renames keys. Alternatively, you could use the GetValues, DeleteKeys and SetValues methods together to delete the old key and set a new key with the old value. The first approach would be more atomic, though.

At the moment, only replication clusters exist without sharding. So the key should be renamed across the entire cluster.

@kelvinmwinuka kelvinmwinuka added enhancement New feature or request good first issue Good for newcomers labels Jun 15, 2024
@dotslashbit
Copy link
Contributor

working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants