Open ThiefMaster opened 11 years ago
I agree that it would be great to have Lua support. I've been thinking about how to best accomplish this. Unfortunately, I had trouble installing the official lunatic-python package and it seem like it doesn't support lua 5.1, but I'm looking into other alternative approaches. I've had success with some of the other lunatic-python forks though so maybe that's the best approach.
fakeredis 0.10.1 has some scripting support (eval
command), but I'm leaving this open because it's still incomplete.
FYI all, to get Lua support, you need to install it like:
pip install fakeredis[lua]
Documentation should be updated..
Good point. I've updated the README on the 1.0 branch. It'll appear in the README when I release 1.0, which should be quite soon.
Great, waiting for it. This has been a good drop-in replacement for mockredis
which is abandoned, or so it seems.
I've opened a PR for SCRIPT EXISTS
and SCRIPT FLUSH
. Not sure if the implementation is up to standards, but it's here: #281.
cjson is not supported :(
Error running script (call to f_7cfc597423ec5ba5cf79190e397fb9dbeaf35226): @user_script:?: [string "<python>"]:139: attempt to index a nil value (global 'cjson')
It would be nice if fakeredis supported LUA scripts like redis does. LUA bindings for python are available so it might not be that hard - never used them though.
Why would it be useful? Well, chances are good that the usage of lua scripts means there is some more complex logic involved that cannot be easily done with simply redis commands. Chances are good that this logic should be well-tested and thus having lua support in fakeredis would be helpful.