-
Notifications
You must be signed in to change notification settings - Fork 26
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
Extend SugarDB Commands Using Lua Scripts #155
Merged
kelvinmwinuka
merged 44 commits into
EchoVault:main
from
kelvinmwinuka:feature/lua-scripts
Dec 12, 2024
Merged
Extend SugarDB Commands Using Lua Scripts #155
kelvinmwinuka
merged 44 commits into
EchoVault:main
from
kelvinmwinuka:feature/lua-scripts
Dec 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… for generating LUA script command into plugin_lua.go file.
… for generating LUA script command into plugin_lua.go file.
…a/SugarDB into feature/lua-scripts
… for lua key extraction and handler functions that only expect one return type, the correct one. When there's an error, the functions should throw an error instead of returning an error string. Implemented error handlers when calling key extraction and handler functions so that errors from the lua script will be safely returned to the user. Implemented script locking when executing a script command.
…nstead of running each module test separately.
…ll be used as the module name
…mplemented lua scripts for zset, set, hash, and other primitive types along with tests for the lua scripts.
Tested locally and working as documented from what I can tell. I would recommend we add a response to the MODULE UNLOAD command to give a confirmation that the command completes successfully, but that can be handled in another PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change allows the user to define new commands using Lua. This extends the functionality of the existing
MODULE LOAD
command. Now the user can can runMODULE LOAD path/to/script.lua [args ...]
to load a new command that's defined by a Lua script.Just like regular .so modules, lua modules can be removed using
MODULE UNLOAD <module-name>
, where module name is the name of the lua module as displayed by theMODULE LIST
command.To view the documentation:
npm install -g pnpm
cd docs
pnpm install
pnpm run start
The documentation for Lua extensions can be found at
/docs/extension/lua