valkey-glide 2.0.0rc3__cp310-cp310-macosx_11_0_arm64.whl → 2.2.3__cp310-cp310-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- glide/__init__.py +160 -106
- glide/async_commands/cluster_commands.py +108 -105
- glide/async_commands/core.py +637 -444
- glide/async_commands/{server_modules/ft.py → ft.py} +8 -7
- glide/async_commands/{server_modules/glide_json.py → glide_json.py} +15 -92
- glide/async_commands/standalone_commands.py +27 -58
- glide/glide.cpython-310-darwin.so +0 -0
- glide/glide.pyi +26 -1
- glide/glide_client.py +269 -125
- glide/logger.py +33 -21
- glide/opentelemetry.py +185 -0
- glide_shared/__init__.py +330 -0
- glide_shared/commands/__init__.py +0 -0
- {glide/async_commands → glide_shared/commands}/batch.py +476 -64
- glide_shared/commands/batch_options.py +261 -0
- glide_shared/commands/core_options.py +407 -0
- {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_aggregate_options.py +3 -3
- {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_create_options.py +4 -2
- {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_profile_options.py +4 -4
- {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_search_options.py +4 -2
- {glide/async_commands → glide_shared/commands}/server_modules/json_batch.py +4 -4
- glide_shared/commands/server_modules/json_options.py +93 -0
- {glide/async_commands → glide_shared/commands}/sorted_set.py +2 -2
- {glide/async_commands → glide_shared/commands}/stream.py +1 -1
- {glide → glide_shared}/config.py +386 -61
- {glide → glide_shared}/constants.py +3 -3
- {glide → glide_shared}/exceptions.py +27 -1
- glide_shared/protobuf/command_request_pb2.py +56 -0
- glide_shared/protobuf/connection_request_pb2.py +56 -0
- {glide → glide_shared}/protobuf/response_pb2.py +6 -6
- {glide → glide_shared}/routes.py +54 -15
- valkey_glide-2.2.3.dist-info/METADATA +211 -0
- valkey_glide-2.2.3.dist-info/RECORD +40 -0
- glide/protobuf/command_request_pb2.py +0 -54
- glide/protobuf/command_request_pb2.pyi +0 -1187
- glide/protobuf/connection_request_pb2.py +0 -54
- glide/protobuf/connection_request_pb2.pyi +0 -320
- glide/protobuf/response_pb2.pyi +0 -100
- valkey_glide-2.0.0rc3.dist-info/METADATA +0 -127
- valkey_glide-2.0.0rc3.dist-info/RECORD +0 -37
- {glide/async_commands → glide_shared/commands}/bitmap.py +0 -0
- {glide/async_commands → glide_shared/commands}/command_args.py +0 -0
- {glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_constants.py +0 -0
- {glide → glide_shared}/protobuf_codec.py +0 -0
- {valkey_glide-2.0.0rc3.dist-info → valkey_glide-2.2.3.dist-info}/WHEEL +0 -0
{glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_profile_options.py
RENAMED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
from enum import Enum
|
|
3
3
|
from typing import List, Optional, Union, cast
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from glide_shared.commands.server_modules.ft_options.ft_aggregate_options import (
|
|
6
6
|
FtAggregateOptions,
|
|
7
7
|
)
|
|
8
|
-
from
|
|
8
|
+
from glide_shared.commands.server_modules.ft_options.ft_constants import (
|
|
9
9
|
FtProfileKeywords,
|
|
10
10
|
)
|
|
11
|
-
from
|
|
11
|
+
from glide_shared.commands.server_modules.ft_options.ft_search_options import (
|
|
12
12
|
FtSearchOptions,
|
|
13
13
|
)
|
|
14
|
-
from
|
|
14
|
+
from glide_shared.constants import TEncodable
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class QueryType(Enum):
|
{glide/async_commands → glide_shared/commands}/server_modules/ft_options/ft_search_options.py
RENAMED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import List, Mapping, Optional
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
|
|
5
|
+
from glide_shared.commands.server_modules.ft_options.ft_constants import (
|
|
6
|
+
FtSearchKeywords,
|
|
7
|
+
)
|
|
8
|
+
from glide_shared.constants import TEncodable
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
class FtSearchLimit:
|
|
@@ -22,14 +22,14 @@ Examples:
|
|
|
22
22
|
|
|
23
23
|
from typing import List, Optional, Union
|
|
24
24
|
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
25
|
+
from glide_shared.commands.batch import TBatch
|
|
26
|
+
from glide_shared.commands.core_options import ConditionalChange
|
|
27
|
+
from glide_shared.commands.server_modules.json_options import (
|
|
28
28
|
JsonArrIndexOptions,
|
|
29
29
|
JsonArrPopOptions,
|
|
30
30
|
JsonGetOptions,
|
|
31
31
|
)
|
|
32
|
-
from
|
|
32
|
+
from glide_shared.constants import TEncodable
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def set(
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from glide_shared.constants import TEncodable
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class JsonArrIndexOptions:
|
|
9
|
+
"""
|
|
10
|
+
Options for the `JSON.ARRINDEX` command.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
start (int): The inclusive start index from which the search begins. Defaults to None.
|
|
14
|
+
end (Optional[int]): The exclusive end index where the search stops. Defaults to None.
|
|
15
|
+
|
|
16
|
+
Note:
|
|
17
|
+
- If `start` is greater than `end`, the command returns `-1` to indicate that the value was not found.
|
|
18
|
+
- Indices that exceed the array bounds are automatically adjusted to the nearest valid position.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, start: int, end: Optional[int] = None):
|
|
22
|
+
self.start = start
|
|
23
|
+
self.end = end
|
|
24
|
+
|
|
25
|
+
def to_args(self) -> List[str]:
|
|
26
|
+
"""
|
|
27
|
+
Get the options as a list of arguments for the JSON.ARRINDEX command.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
List[str]: A list containing the start and end indices if specified.
|
|
31
|
+
"""
|
|
32
|
+
args = [str(self.start)]
|
|
33
|
+
if self.end is not None:
|
|
34
|
+
args.append(str(self.end))
|
|
35
|
+
return args
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class JsonArrPopOptions:
|
|
39
|
+
"""
|
|
40
|
+
Options for the JSON.ARRPOP command.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
path (TEncodable): The path within the JSON document.
|
|
44
|
+
index (Optional[int]): The index of the element to pop. If not specified, will pop the last element.
|
|
45
|
+
Out of boundary indexes are rounded to their respective array boundaries. Defaults to None.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
def __init__(self, path: TEncodable, index: Optional[int] = None):
|
|
49
|
+
self.path = path
|
|
50
|
+
self.index = index
|
|
51
|
+
|
|
52
|
+
def to_args(self) -> List[TEncodable]:
|
|
53
|
+
"""
|
|
54
|
+
Get the options as a list of arguments for the `JSON.ARRPOP` command.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
List[TEncodable]: A list containing the path and, if specified, the index.
|
|
58
|
+
"""
|
|
59
|
+
args = [self.path]
|
|
60
|
+
if self.index is not None:
|
|
61
|
+
args.append(str(self.index))
|
|
62
|
+
return args
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class JsonGetOptions:
|
|
66
|
+
"""
|
|
67
|
+
Represents options for formatting JSON data, to be used in the [JSON.GET](https://valkey.io/commands/json.get/) command.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
indent (Optional[str]): Sets an indentation string for nested levels. Defaults to None.
|
|
71
|
+
newline (Optional[str]): Sets a string that's printed at the end of each line. Defaults to None.
|
|
72
|
+
space (Optional[str]): Sets a string that's put between a key and a value. Defaults to None.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
def __init__(
|
|
76
|
+
self,
|
|
77
|
+
indent: Optional[str] = None,
|
|
78
|
+
newline: Optional[str] = None,
|
|
79
|
+
space: Optional[str] = None,
|
|
80
|
+
):
|
|
81
|
+
self.indent = indent
|
|
82
|
+
self.new_line = newline
|
|
83
|
+
self.space = space
|
|
84
|
+
|
|
85
|
+
def get_options(self) -> List[str]:
|
|
86
|
+
args = []
|
|
87
|
+
if self.indent:
|
|
88
|
+
args.extend(["INDENT", self.indent])
|
|
89
|
+
if self.new_line:
|
|
90
|
+
args.extend(["NEWLINE", self.new_line])
|
|
91
|
+
if self.space:
|
|
92
|
+
args.extend(["SPACE", self.space])
|
|
93
|
+
return args
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from typing import List, Optional, Tuple, Union, cast
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from glide_shared.commands.command_args import Limit, OrderBy
|
|
7
|
+
from glide_shared.constants import TEncodable
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class InfBound(Enum):
|