-
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 JavaScript Modules #161
Merged
kelvinmwinuka
merged 24 commits into
EchoVault:main
from
kelvinmwinuka:feature/js-scripts
Jan 11, 2025
Merged
Extend SugarDB commands using JavaScript Modules #161
kelvinmwinuka
merged 24 commits into
EchoVault:main
from
kelvinmwinuka:feature/js-scripts
Jan 11, 2025
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
… javascript module key extraction function and handler
…s in docker-compose.yml
…ipt modules can be loaded using LoadModule
… from scriptVMs instead of passing it in from the caller. Implemented JS key extraction function.
…ta type considerations
…bject registry that keeps track of the objects shared between the Go and Otto runtimes
…port for subtract method.
…dlerFunc comments to demonstrate JS objects instead of lua objects
… caught in the otto vm during the handlerFunc execution. Added basis scaffolding for sorted set custom data type support.
… with 'new' keyword instead of using create* format.
…btract method. Added support for lists in js scripts. Map SugarDB data types to js objects when getting values from js script.
…ore asserts in set.js and zset.js
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 JavaScript. This extends the functionality of the existing MODULE LOAD command. Now, the user can run MODULE LOAD path/to/script.js [args ...] to load a new command that's defined by a JS module.
Just like regular .so modules, javascript modules can be removed using MODULE UNLOAD , where the module name is the name of the javascript module as displayed by the MODULE LIST command.
To view the documentation:
Install pnpm - npm install -g pnpm
Navigate to the project's docs subdirectory - cd docs
Install packages - pnpm install
Run the docs server - pnpm run start
The documentation for JavaScript extensions can be found at /docs/extension/js