Skip to content

Instantly share code, notes, and snippets.

@bazilio91
Created March 20, 2015 10:15
Show Gist options
  • Save bazilio91/fc5c9170e74899d2b74c to your computer and use it in GitHub Desktop.
Save bazilio91/fc5c9170e74899d2b74c to your computer and use it in GitHub Desktop.
template.lua
local redis = require 'redis'
local host = "127.0.0.1"
local port = 6379
client = redis.connect(host, port)
redis.call = function(cmd, ...)
return assert(loadstring('return client:' .. string.lower(cmd) .. '(...)'))(...)
end
local function dump(a)
for k, v in pairs(a) do
print(k, v)
end
end
redis.call("SELECT", 15)
-- here you can test your lua
@itamarhaber
Copy link

Or use my little debugger thingy: https://github.com/RedisLabs/redis-lua-debugger 😄

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