tidis icon indicating copy to clipboard operation
tidis copied to clipboard

WIP Add eval command

Open Negashev opened this issue 5 years ago • 0 comments

close #64 Work with simple call

> eval "return redis.call('set','foo','bar')" 0
OK
> GET foo
"bar"
> eval "return redis.call('GET','foo')" 0
bar
> eval "return 10" 0
(integer) 10
> eval "return {1,2,3.3333,'foo',nil,'bar'}" 0 <--- some problems (redis return only 4 keys)
1) (integer) 1
2) (integer) 2
3) (integer) 3
4) "foo"
5) "bar"
> eval "return {1,2,{3,'Hello World!'}}" 0
1) (integer) 1
2) (integer) 2
3) 1) (integer) 3
   2) "Hello World!"
> eval "return redis.call(KEYS[1],KEYS[2], 134)" 2 set foo
OK
> GET foo
134
> eval "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 key1 key2 first second
1) key1
2) key2
3) first
4) second

Ready

  • [x] redis.call from the box
  • [x] KEYS and ARGV in lua
  • [ ] connect to tidis internal without golang redis client

Negashev avatar Mar 05 '19 14:03 Negashev