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

Support LUA scripting #25

Open
ThiefMaster opened this issue Apr 17, 2013 · 7 comments
Open

Support LUA scripting #25

ThiefMaster opened this issue Apr 17, 2013 · 7 comments

Comments

@ThiefMaster
Copy link

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.

@jamesls
Copy link
Owner

jamesls commented Apr 18, 2013

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.

@bmerry
Copy link
Collaborator

bmerry commented Mar 22, 2018

fakeredis 0.10.1 has some scripting support (eval command), but I'm leaving this open because it's still incomplete.

@advance512
Copy link

FYI all, to get Lua support, you need to install it like:

pip install fakeredis[lua]

Documentation should be updated..

@bmerry
Copy link
Collaborator

bmerry commented Jan 17, 2019

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.

@advance512
Copy link

Great, waiting for it. This has been a good drop-in replacement for mockredis which is abandoned, or so it seems.

locationlabs/mockredis#130

@SebastiaanZ
Copy link
Contributor

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.

@rodriguez-facundo
Copy link

cjson is not supported :(

Error running script (call to f_7cfc597423ec5ba5cf79190e397fb9dbeaf35226): @user_script:?: [string "<python>"]:139: attempt to index a nil value (global 'cjson')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants