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

Extend SugarDB commands using JavaScript Modules #161

Merged
merged 24 commits into from
Jan 11, 2025

Conversation

kelvinmwinuka
Copy link
Collaborator

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

… javascript module key extraction function and handler
… from scriptVMs instead of passing it in from the caller. Implemented JS key extraction function.
…bject registry that keeps track of the objects shared between the Go and Otto runtimes
…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.
@kelvinmwinuka kelvinmwinuka self-assigned this Jan 8, 2025
@kelvinmwinuka kelvinmwinuka merged commit 136d7c6 into EchoVault:main Jan 11, 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