Skip to content

Commit

Permalink
Add documentation about unimplemented 7.4 commands
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Dec 3, 2024
1 parent bf22441 commit 0dff7f7
Show file tree
Hide file tree
Showing 6 changed files with 331 additions and 435 deletions.
13 changes: 13 additions & 0 deletions coredis/commands/_key_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ class KeySpec:
b"GETBIT": lambda args: ((args[1],)),
b"GETRANGE": lambda args: ((args[1],)),
b"HEXISTS": lambda args: ((args[1],)),
b"HEXPIRETIME": lambda args: ((args[1],)),
b"HGET": lambda args: ((args[1],)),
b"HGETALL": lambda args: ((args[1],)),
b"HKEYS": lambda args: ((args[1],)),
b"HLEN": lambda args: ((args[1],)),
b"HMGET": lambda args: ((args[1],)),
b"HPEXPIRETIME": lambda args: ((args[1],)),
b"HPTTL": lambda args: ((args[1],)),
b"HRANDFIELD": lambda args: ((args[1],)),
b"HSCAN": lambda args: ((args[1],)),
b"HSTRLEN": lambda args: ((args[1],)),
b"HTTL": lambda args: ((args[1],)),
b"HVALS": lambda args: ((args[1],)),
b"LCS": lambda args: (args[1:2]),
b"LINDEX": lambda args: ((args[1],)),
Expand Down Expand Up @@ -154,9 +158,14 @@ class KeySpec:
b"GETEX": lambda args: ((args[1],)),
b"GETSET": lambda args: ((args[1],)),
b"HDEL": lambda args: ((args[1],)),
b"HEXPIRE": lambda args: ((args[1],)),
b"HEXPIREAT": lambda args: ((args[1],)),
b"HINCRBY": lambda args: ((args[1],)),
b"HINCRBYFLOAT": lambda args: ((args[1],)),
b"HMSET": lambda args: ((args[1],)),
b"HPERSIST": lambda args: ((args[1],)),
b"HPEXPIRE": lambda args: ((args[1],)),
b"HPEXPIREAT": lambda args: ((args[1],)),
b"HSET": lambda args: ((args[1],)),
b"HSETNX": lambda args: ((args[1],)),
b"INCR": lambda args: ((args[1],)),
Expand Down Expand Up @@ -271,14 +280,18 @@ class KeySpec:
b"GETBIT": lambda args: ((args[1],)),
b"GETRANGE": lambda args: ((args[1],)),
b"HEXISTS": lambda args: ((args[1],)),
b"HEXPIRETIME": lambda args: ((args[1],)),
b"HGET": lambda args: ((args[1],)),
b"HGETALL": lambda args: ((args[1],)),
b"HKEYS": lambda args: ((args[1],)),
b"HLEN": lambda args: ((args[1],)),
b"HMGET": lambda args: ((args[1],)),
b"HPEXPIRETIME": lambda args: ((args[1],)),
b"HPTTL": lambda args: ((args[1],)),
b"HRANDFIELD": lambda args: ((args[1],)),
b"HSCAN": lambda args: ((args[1],)),
b"HSTRLEN": lambda args: ((args[1],)),
b"HTTL": lambda args: ((args[1],)),
b"HVALS": lambda args: ((args[1],)),
b"LCS": lambda args: (args[1:2]),
b"LINDEX": lambda args: ((args[1],)),
Expand Down
11 changes: 10 additions & 1 deletion coredis/commands/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,15 @@ class CommandName(CaseAndEncodingInsensitiveEnum):
HSCAN = b"HSCAN" # Since redis: 2.8.0
HSTRLEN = b"HSTRLEN" # Since redis: 3.2.0
HRANDFIELD = b"HRANDFIELD" # Since redis: 6.2.0
HEXPIRE = b"HEXPIRE" # Since redis: 7.4.0
HEXPIREAT = b"HEXPIREAT" # Since redis: 7.4.0
HEXPIRETIME = b"HEXPIRETIME" # Since redis: 7.4.0
HPERSIST = b"HPERSIST" # Since redis: 7.4.0
HPEXPIRE = b"HPEXPIRE" # Since redis: 7.4.0
HPEXPIREAT = b"HPEXPIREAT" # Since redis: 7.4.0
HPEXPIRETIME = b"HPEXPIRETIME" # Since redis: 7.4.0
HPTTL = b"HPTTL" # Since redis: 7.4.0
HTTL = b"HTTL" # Since redis: 7.4.0
HMSET = b"HMSET" # Deprecated in redis: 4.0.0

#: Commands for hyperloglog
Expand Down Expand Up @@ -431,7 +440,6 @@ class CommandName(CaseAndEncodingInsensitiveEnum):
JSON_OBJKEYS = b"JSON.OBJKEYS" # Since RedisJSON: 1.0.0
JSON_OBJLEN = b"JSON.OBJLEN" # Since RedisJSON: 1.0.0
JSON_TYPE = b"JSON.TYPE" # Since RedisJSON: 1.0.0
JSON_RESP = b"JSON.RESP" # Since RedisJSON: 1.0.0
JSON_DEBUG = b"JSON.DEBUG" # Since RedisJSON: 1.0.0
JSON_DEBUG_HELP = b"JSON.DEBUG HELP" # Since RedisJSON: 1.0.0
JSON_DEBUG_MEMORY = b"JSON.DEBUG MEMORY" # Since RedisJSON: 1.0.0
Expand All @@ -440,6 +448,7 @@ class CommandName(CaseAndEncodingInsensitiveEnum):
JSON_MSET = b"JSON.MSET" # Since RedisJSON: 2.6.0
JSON_MERGE = b"JSON.MERGE" # Since RedisJSON: 2.6.0
JSON_NUMMULTBY = b"JSON.NUMMULTBY" # Deprecated in RedisJSON: 2.0
JSON_RESP = b"JSON.RESP" # Deprecated in RedisJSON: 2.6

#: Commands for bf
BF_RESERVE = b"BF.RESERVE" # Since bf: 1.0.0
Expand Down
45 changes: 40 additions & 5 deletions coredis/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ class PureToken(CaseAndEncodingInsensitiveEnum):
#:
#: - ``EXPIRE``
#: - ``EXPIREAT``
#: - ``HEXPIRE``
#: - ``HEXPIREAT``
#: - ``HPEXPIRE``
#: - ``HPEXPIREAT``
#: - ``PEXPIRE``
#: - ``PEXPIREAT``
#: - ``ZADD``
Expand All @@ -286,6 +290,10 @@ class PureToken(CaseAndEncodingInsensitiveEnum):
#:
#: - ``EXPIRE``
#: - ``EXPIREAT``
#: - ``HEXPIRE``
#: - ``HEXPIREAT``
#: - ``HPEXPIRE``
#: - ``HPEXPIREAT``
#: - ``PEXPIRE``
#: - ``PEXPIREAT``
#: - ``ZADD``
Expand All @@ -296,6 +304,10 @@ class PureToken(CaseAndEncodingInsensitiveEnum):
#: - ``EXPIRE``
#: - ``EXPIREAT``
#: - ``GEOADD``
#: - ``HEXPIRE``
#: - ``HEXPIREAT``
#: - ``HPEXPIRE``
#: - ``HPEXPIREAT``
#: - ``JSON.SET``
#: - ``PEXPIRE``
#: - ``PEXPIREAT``
Expand All @@ -308,6 +320,10 @@ class PureToken(CaseAndEncodingInsensitiveEnum):
#: - ``EXPIRE``
#: - ``EXPIREAT``
#: - ``GEOADD``
#: - ``HEXPIRE``
#: - ``HEXPIREAT``
#: - ``HPEXPIRE``
#: - ``HPEXPIREAT``
#: - ``JSON.SET``
#: - ``PEXPIRE``
#: - ``PEXPIREAT``
Expand Down Expand Up @@ -922,6 +938,16 @@ class PureToken(CaseAndEncodingInsensitiveEnum):
#: - ``FT.CREATE``
HASH = b"HASH"

#: Used by:
#:
#: - ``FT.CREATE``
INDEXEMPTY = b"INDEXEMPTY"

#: Used by:
#:
#: - ``FT.CREATE``
INDEXMISSING = b"INDEXMISSING"

#: Used by:
#:
#: - ``FT.CREATE``
Expand Down Expand Up @@ -1394,6 +1420,20 @@ class PrefixToken(CaseAndEncodingInsensitiveEnum):
#: - ``HELLO``
SETNAME = b"SETNAME"

#: Used by:
#:
#: - ``FT.SEARCH``
#: - ``HEXPIRE``
#: - ``HEXPIREAT``
#: - ``HEXPIRETIME``
#: - ``HPERSIST``
#: - ``HPEXPIRE``
#: - ``HPEXPIREAT``
#: - ``HPEXPIRETIME``
#: - ``HPTTL``
#: - ``HTTL``
FIELDS = b"FIELDS"

#: Used by:
#:
#: - ``HSCAN``
Expand Down Expand Up @@ -1757,11 +1797,6 @@ class PrefixToken(CaseAndEncodingInsensitiveEnum):
#: - ``FT.SEARCH``
EXPANDER = b"EXPANDER"

#: Used by:
#:
#: - ``FT.SEARCH``
FIELDS = b"FIELDS"

#: Used by:
#:
#: - ``FT.SEARCH``
Expand Down
90 changes: 90 additions & 0 deletions docs/source/compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,96 @@ Returns all values in a hash.



HEXPIRE [X]
***********

Set expiry for hash field using relative time to expire (seconds)

- Documentation: `HEXPIRE <https://redis.io/commands/hexpire>`_

- Not Implemented


HEXPIREAT [X]
*************

Set expiry for hash field using an absolute Unix timestamp (seconds)

- Documentation: `HEXPIREAT <https://redis.io/commands/hexpireat>`_

- Not Implemented


HEXPIRETIME [X]
***************

Returns the expiration time of a hash field as a Unix timestamp, in seconds.

- Documentation: `HEXPIRETIME <https://redis.io/commands/hexpiretime>`_

- Not Implemented


HPERSIST [X]
************

Removes the expiration time for each specified field

- Documentation: `HPERSIST <https://redis.io/commands/hpersist>`_

- Not Implemented


HPEXPIRE [X]
************

Set expiry for hash field using relative time to expire (milliseconds)

- Documentation: `HPEXPIRE <https://redis.io/commands/hpexpire>`_

- Not Implemented


HPEXPIREAT [X]
**************

Set expiry for hash field using an absolute Unix timestamp (milliseconds)

- Documentation: `HPEXPIREAT <https://redis.io/commands/hpexpireat>`_

- Not Implemented


HPEXPIRETIME [X]
****************

Returns the expiration time of a hash field as a Unix timestamp, in msec.

- Documentation: `HPEXPIRETIME <https://redis.io/commands/hpexpiretime>`_

- Not Implemented


HPTTL [X]
*********

Returns the TTL in milliseconds of a hash field.

- Documentation: `HPTTL <https://redis.io/commands/hpttl>`_

- Not Implemented


HTTL [X]
********

Returns the TTL in seconds of a hash field.

- Documentation: `HTTL <https://redis.io/commands/httl>`_

- Not Implemented





Expand Down
2 changes: 1 addition & 1 deletion scripts/code_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ def code_gen(ctx, debug: bool, next_version: str):
os.system("git clone [email protected]:redis/docs /var/tmp/redis-doc")
else:
os.system("cd /var/tmp/redis-doc && git pull")
shutil.copy("/var/tmp/redis-doc/data/commands.json", cur_dir)
shutil.copy("/var/tmp/redis-doc/data/commands_core.json", os.path.join(cur_dir, "commands.json"))
for module, details in MODULES.items():
if not os.path.isdir(f"/var/tmp/redis-module-{details['module']}"):
os.system(
Expand Down
Loading

0 comments on commit 0dff7f7

Please sign in to comment.