Skip to content

Commit

Permalink
[new] Update Redis command spec (2024-05-27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed May 27, 2024
1 parent ad54fea commit e3b8c1b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 18 deletions.
4 changes: 2 additions & 2 deletions resources/carmine-commands.edn
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"RENAME" {:fn-name "rename", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [key newkey], :req-args-fixed ["RENAME" key newkey], :fn-docstring "`RENAME` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(1)\n\nRenames a key and overwrites the destination.\nRef. https://redis.io/commands/rename/ for more info."}
"RENAMENX" {:fn-name "renamenx", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [key newkey], :req-args-fixed ["RENAMENX" key newkey], :fn-docstring "`RENAMENX` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(1)\n\nRenames a key only when the target key name doesn't exist.\nRef. https://redis.io/commands/renamenx/ for more info."}
"REPLCONF" {:fn-name "replconf", :cluster-key-idx 1, :fn-params-more [& args], :fn-params-fixed [], :req-args-fixed ["REPLCONF"], :fn-docstring "`REPLCONF` - Redis command function.\n Available since: Redis 3.0.0\n Complexity: O(1)\n\nAn internal command for configuring the replication stream.\nRef. https://redis.io/commands/replconf/ for more info."}
"REPLICAOF" {:fn-name "replicaof", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [host port], :req-args-fixed ["REPLICAOF" host port], :fn-docstring "`REPLICAOF` - Redis command function.\n Available since: Redis 5.0.0\n Complexity: O(1)\n\nConfigures a server as replica of another, or promotes it to a master.\nRef. https://redis.io/commands/replicaof/ for more info."}
"REPLICAOF" {:fn-name "replicaof", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [arg1 arg2], :req-args-fixed ["REPLICAOF" arg1 arg2], :fn-docstring "`REPLICAOF` - Redis command function.\n Available since: Redis 5.0.0\n Complexity: O(1)\n\nConfigures a server as replica of another, or promotes it to a master.\nRef. https://redis.io/commands/replicaof/ for more info."}
"RESET" {:fn-name "reset", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [], :req-args-fixed ["RESET"], :fn-docstring "`RESET` - Redis command function.\n Available since: Redis 6.2.0\n Complexity: O(1)\n\nResets the connection.\nRef. https://redis.io/commands/reset/ for more info."}
"RESTORE" {:fn-name "restore", :cluster-key-idx 1, :fn-params-more [key ttl serialized-value & args], :fn-params-fixed [key ttl serialized-value], :req-args-fixed ["RESTORE" key ttl serialized-value], :fn-docstring "`RESTORE` - Redis command function.\n Available since: Redis 2.6.0\n Complexity: O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).\n\nCreates a key from the serialized representation of a value.\nRef. https://redis.io/commands/restore/ for more info."}
"RESTORE-ASKING" {:fn-name "restore-asking", :cluster-key-idx 1, :fn-params-more [key ttl serialized-value & args], :fn-params-fixed [key ttl serialized-value], :req-args-fixed ["RESTORE-ASKING" key ttl serialized-value], :fn-docstring "`RESTORE-ASKING` - Redis command function.\n Available since: Redis 3.0.0\n Complexity: O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).\n\nAn internal command for migrating keys in a cluster.\nRef. https://redis.io/commands/restore-asking/ for more info."}
Expand Down Expand Up @@ -277,7 +277,7 @@
"SINTERCARD" {:fn-name "sintercard", :cluster-key-idx 1, :fn-params-more [numkeys key & args], :fn-params-fixed [numkeys key], :req-args-fixed ["SINTERCARD" numkeys key], :fn-docstring "`SINTERCARD` - Redis command function.\n Available since: Redis 7.0.0\n Complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.\n\nReturns the number of members of the intersect of multiple sets.\nRef. https://redis.io/commands/sintercard/ for more info."}
"SINTERSTORE" {:fn-name "sinterstore", :cluster-key-idx 1, :fn-params-more [destination key & args], :fn-params-fixed [destination key], :req-args-fixed ["SINTERSTORE" destination key], :fn-docstring "`SINTERSTORE` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.\n\nStores the intersect of multiple sets in a key.\nRef. https://redis.io/commands/sinterstore/ for more info."}
"SISMEMBER" {:fn-name "sismember", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [key member], :req-args-fixed ["SISMEMBER" key member], :fn-docstring "`SISMEMBER` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(1)\n\nDetermines whether a member belongs to a set.\nRef. https://redis.io/commands/sismember/ for more info."}
"SLAVEOF" {:fn-name "slaveof", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [host port], :req-args-fixed ["SLAVEOF" host port], :fn-docstring "`SLAVEOF` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(1)\n\nSets a Redis server as a replica of another, or promotes it to being a master.\nRef. https://redis.io/commands/slaveof/ for more info."}
"SLAVEOF" {:fn-name "slaveof", :cluster-key-idx 1, :fn-params-more nil, :fn-params-fixed [arg1 arg2], :req-args-fixed ["SLAVEOF" arg1 arg2], :fn-docstring "`SLAVEOF` - Redis command function.\n Available since: Redis 1.0.0\n Complexity: O(1)\n\nSets a Redis server as a replica of another, or promotes it to being a master.\nRef. https://redis.io/commands/slaveof/ for more info."}
"SLOWLOG" {:fn-name "slowlog", :cluster-key-idx 1, :fn-params-more [arg1 & args], :fn-params-fixed [arg1], :req-args-fixed ["SLOWLOG" arg1], :fn-docstring "`SLOWLOG` - Redis command function.\n Available since: Redis 2.2.12\n Complexity: Depends on subcommand.\n\nA container for slow log commands.\nRef. https://redis.io/commands/slowlog/ for more info."}
"SLOWLOG GET" {:fn-name "slowlog-get", :cluster-key-idx 2, :fn-params-more [& args], :fn-params-fixed [], :req-args-fixed ["SLOWLOG" "GET"], :fn-docstring "`SLOWLOG GET` - Redis command function.\n Available since: Redis 2.2.12\n Complexity: O(N) where N is the number of entries returned\n\nReturns the slow log's entries.\nRef. https://redis.io/commands/slowlog-get/ for more info."}
"SLOWLOG HELP" {:fn-name "slowlog-help", :cluster-key-idx 2, :fn-params-more nil, :fn-params-fixed [], :req-args-fixed ["SLOWLOG" "HELP"], :fn-docstring "`SLOWLOG HELP` - Redis command function.\n Available since: Redis 6.2.0\n Complexity: O(1)\n\nShow helpful text about the different subcommands\nRef. https://redis.io/commands/slowlog-help/ for more info."}
Expand Down
92 changes: 76 additions & 16 deletions resources/redis-commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -11073,14 +11073,44 @@
"arity": 3,
"arguments": [
{
"name": "host",
"type": "string",
"display_text": "host"
},
{
"name": "port",
"type": "integer",
"display_text": "port"
"name": "args",
"type": "oneof",
"arguments": [
{
"name": "host-port",
"type": "block",
"arguments": [
{
"name": "host",
"type": "string",
"display_text": "host"
},
{
"name": "port",
"type": "integer",
"display_text": "port"
}
]
},
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "pure-token",
"display_text": "no",
"token": "NO"
},
{
"name": "one",
"type": "pure-token",
"display_text": "one",
"token": "ONE"
}
]
}
]
}
],
"command_flags": [
Expand Down Expand Up @@ -12743,14 +12773,44 @@
"arity": 3,
"arguments": [
{
"name": "host",
"type": "string",
"display_text": "host"
},
{
"name": "port",
"type": "integer",
"display_text": "port"
"name": "args",
"type": "oneof",
"arguments": [
{
"name": "host-port",
"type": "block",
"arguments": [
{
"name": "host",
"type": "string",
"display_text": "host"
},
{
"name": "port",
"type": "integer",
"display_text": "port"
}
]
},
{
"name": "no-one",
"type": "block",
"arguments": [
{
"name": "no",
"type": "pure-token",
"display_text": "no",
"token": "NO"
},
{
"name": "one",
"type": "pure-token",
"display_text": "one",
"token": "ONE"
}
]
}
]
}
],
"command_flags": [
Expand Down

0 comments on commit e3b8c1b

Please sign in to comment.