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

Adds support for running EVAL with different scripting engines #1497

Draft
wants to merge 6 commits into
base: unstable
Choose a base branch
from

Conversation

rjd15372
Copy link
Contributor

NOTE: This PR sits on top of #1312 and therefore, it will be kept in draft mode until #1312 is merged.

In this PR re-implement the EVAL commands (EVAL, EVALSHA, SCRIPT LOAD, etc...) to use the scripting engine infrastructure introduced in 6adef8e. This allows EVAL to run scripts using different scripting engines.

This new implementation generalizes the module API for implementing scripting engines to work with both FUNCTION and EVAL commands.

This commit creates a new unit for the scripting engine code by
extracting the existing code from the functions unit.

We're doing this refactor to prepare the code for runnning the `EVAL`
command using different scripting engines.

Signed-off-by: Ricardo Dias <[email protected]>
…eate library callback

Instead of using C strings to return the errors that may be happen
during the code parsing of a scripting engine, use `robj` strings.

This commit also removes the `valkey_asprintf` function, since it's not
used in any place anymore.

Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 65.03165% with 442 lines in your changes missing coverage. Please review.

Project coverage is 70.92%. Comparing base (d00c856) to head (f0c2edc).
Report is 9 commits behind head on unstable.

Files with missing lines Patch % Lines
src/lua/debug_lua.c 39.48% 351 Missing ⚠️
src/scripting_engine.c 79.33% 25 Missing ⚠️
src/lua/engine_lua.c 88.41% 19 Missing ⚠️
src/eval.c 92.42% 15 Missing ⚠️
src/server.c 28.57% 10 Missing ⚠️
src/lua/script_lua.c 70.00% 9 Missing ⚠️
src/module.c 11.11% 8 Missing ⚠️
src/functions.c 95.55% 4 Missing ⚠️
src/lua/function_lua.c 97.87% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1497      +/-   ##
============================================
+ Coverage     70.86%   70.92%   +0.05%     
============================================
  Files           119      122       +3     
  Lines         64852    65072     +220     
============================================
+ Hits          45958    46150     +192     
- Misses        18894    18922      +28     
Files with missing lines Coverage Δ
src/aof.c 80.11% <ø> (ø)
src/defrag.c 91.79% <ø> (+1.88%) ⬆️
src/lazyfree.c 86.11% <100.00%> (ø)
src/rdb.c 76.58% <ø> (+0.11%) ⬆️
src/server.h 100.00% <ø> (ø)
src/util.c 71.32% <ø> (-0.43%) ⬇️
src/lua/function_lua.c 98.69% <97.87%> (ø)
src/functions.c 94.29% <95.55%> (+2.29%) ⬆️
src/module.c 9.63% <11.11%> (+<0.01%) ⬆️
src/lua/script_lua.c 89.63% <70.00%> (ø)
... and 5 more

... and 12 files with indirect coverage changes

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