Skip to content

Added new Commands#5

Merged
itsfuad merged 2 commits intostablefrom
main
Sep 19, 2025
Merged

Added new Commands#5
itsfuad merged 2 commits intostablefrom
main

Conversation

@itsfuad
Copy link
Owner

@itsfuad itsfuad commented Sep 19, 2025

This pull request introduces two new list commands (LGET and LLEN) and replaces the set command SMEMBERS with SGET throughout the codebase. The changes include updates to the command handlers, tests, documentation, and command whitelisting to support these new and renamed commands.

List command enhancements:

  • Added lgetHandler and llengHandler functions to internal/db/db.go to implement the new LGET (get all list elements) and LLEN (get list length) commands.
  • Registered LGET and LLEN in the Commands map in internal/db/db.go so they are available in the REPL and scripts.
  • Updated tests in internal/db/db_test.go to cover the new list commands and their edge cases.

Set command renaming:

  • Replaced the smembersHandler function with sgetHandler and updated its usage throughout the codebase, including command registration, tests, and snapshot logic. [1] [2] [3]

Documentation and help updates:

  • Updated readme.md to document the new LGET, LLEN, and SGET commands and removed references to the old SMEMBERS command. [1] [2]
  • Updated the help output in internal/repl/repl.go to reflect the new and renamed commands.

Script command whitelisting:

  • Added LGET, LLEN, and SGET to the script command whitelist in internal/script/script.go to allow their usage in scripts.

Cleanup:

  • Removed an unused import of furr/internal/handlers from cmd/furrdb/main.go.

@itsfuad itsfuad merged commit c7559e6 into stable Sep 19, 2025
2 checks passed
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.

1 participant