X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/928394cd12eb75c35eac72952b29e4dc9e75d154..913e9d6bcacfa28ace3b7ee1c75f8ec4e146974b:/client-libraries/lua/redis.lua?ds=sidebyside diff --git a/client-libraries/lua/redis.lua b/client-libraries/lua/redis.lua index 2455ceb3..1e85ffd8 100644 --- a/client-libraries/lua/redis.lua +++ b/client-libraries/lua/redis.lua @@ -239,6 +239,7 @@ redis_commands = { set_preserve = bulk('SETNX', toboolean), get = inline('GET'), get_multiple = inline('MGET'), + get_set = bulk('GETSET'), increment = inline('INCR'), increment_by = inline('INCRBY'), decrement = inline('DECR'), @@ -262,6 +263,7 @@ redis_commands = { rename_preserve = inline('RENAMENX'), expire = inline('EXPIRE', toboolean), database_size = inline('DBSIZE'), + time_to_live = inline('TTL'), -- commands operating on lists push_tail = bulk('RPUSH'), @@ -276,12 +278,17 @@ redis_commands = { pop_last = inline('RPOP'), -- commands operating on sets - set_add = inline('SADD'), - set_remove = inline('SREM'), + set_add = bulk('SADD'), + set_remove = bulk('SREM'), + set_move = bulk('SMOVE'), set_cardinality = inline('SCARD'), set_is_member = inline('SISMEMBER'), set_intersection = inline('SINTER'), set_intersection_store = inline('SINTERSTORE'), + set_union = inline('SUNION'), + set_union_store = inline('SUNIONSTORE'), + set_diff = inline('SDIFF'), + set_diff_store = inline('SDIFFSTORE'), set_members = inline('SMEMBERS'), -- multiple databases handling commands @@ -316,12 +323,12 @@ redis_commands = { function(client, command) -- let's fire and forget! the connection is closed as soon -- as the SHUTDOWN command is received by the server. - network.write(command .. protocol.newline) + network.write(client, command .. protocol.newline) end ), -- remote server control commands - info = inline('INFO', + info = inline('INFO', function(response) local info = {} response:gsub('([^\r\n]*)\r\n', function(kv) @@ -331,4 +338,10 @@ redis_commands = { return info end ), + slave_of = inline('SLAVEOF'), + slave_of_no_one = custom('SLAVEOF', + function(client, command) + return request.inline(client, command, 'NO ONE') + end + ), }