glide_shared.commands.core_options
PubSubMsg
dataclass
Describes the incoming pubsub message
Attributes:
| Name | Type | Description |
|---|---|---|
message |
TEncodable
|
Incoming message. |
channel |
TEncodable
|
Name of an channel that triggered the message. |
pattern |
Optional[TEncodable]
|
Pattern that triggered the message. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
MonitorMsg
dataclass
Represents a single line received from the MONITOR command.
Attributes:
| Name | Type | Description |
|---|---|---|
timestamp |
float
|
Unix timestamp of the command. |
db |
int
|
Database index on which the command was executed. |
client_addr |
str
|
Address of the client that issued the command. |
command |
str
|
The command name. |
args |
List[str]
|
The command arguments. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
ConditionalChange
Bases: Enum
A condition to the SET, ZADD, GEOADD and HSETEX commands.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
ONLY_IF_EXISTS = 'XX'
class-attribute
instance-attribute
Only update key / elements that already exist. Equivalent to XX in the Valkey API.
ONLY_IF_DOES_NOT_EXIST = 'NX'
class-attribute
instance-attribute
Only set key / add elements that does not already exist. Equivalent to NX in the Valkey API.
HashFieldConditionalChange
Bases: Enum
Field conditional change options for HSETEX command.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
66 67 68 69 70 71 72 73 74 75 | |
ONLY_IF_ALL_EXIST = 'FXX'
class-attribute
instance-attribute
Only set fields if all of them already exist. Equivalent to FXX in the Valkey API.
ONLY_IF_NONE_EXIST = 'FNX'
class-attribute
instance-attribute
Only set fields if none of them already exist. Equivalent to FNX in the Valkey API.
ValueComparison
dataclass
Bases: ABC
A condition that compares the current value of a key to a comparison value.
Attributes:
| Name | Type | Description |
|---|---|---|
comparison_value |
TEncodable
|
The value to compare to the current value of a key. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
OnlyIfEqual
dataclass
Bases: ValueComparison
A condition that is met if the key exists and its current value is equal to the comparison value.
Used by the SET command. Equivalent to the IFEQ comparison-value in the Valkey API.
Not supported when compression is enabled. See
Valkey GLIDE - Data Compression <https://glide.valkey.io/concepts/client-features/compression/#incompatible-commands>_.
Since: Valkey 8.1.0.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
97 98 99 100 101 102 103 104 105 106 107 108 109 | |
OnlyIfNotEqual
dataclass
Bases: ValueComparison
A condition that is met if the key does not exist or its current value is not equal to the comparison value.
Used by the SET command. Equivalent to the IFNE comparison-value in the Valkey API.
Not supported when compression is enabled. See
Valkey GLIDE - Data Compression <https://glide.valkey.io/concepts/client-features/compression/#incompatible-commands>_.
Since: Valkey 9.2.0.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
112 113 114 115 116 117 118 119 120 121 122 123 124 | |
ExpiryType
Bases: Enum
SET option: The type of the expiry.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
SEC = (0, Union[int, timedelta])
class-attribute
instance-attribute
Set the specified expire time, in seconds. Equivalent to EX in the Valkey API.
MILLSEC = (1, Union[int, timedelta])
class-attribute
instance-attribute
Set the specified expire time, in milliseconds. Equivalent to PX in the Valkey API.
UNIX_SEC = (2, Union[int, datetime])
class-attribute
instance-attribute
Set the specified Unix time at which the key will expire, in seconds. Equivalent to EXAT in the Valkey API.
UNIX_MILLSEC = (3, Union[int, datetime])
class-attribute
instance-attribute
Set the specified Unix time at which the key will expire, in milliseconds. Equivalent to PXAT in the Valkey API.
KEEP_TTL = (4, Type[None])
class-attribute
instance-attribute
Retain the time to live associated with the key. Equivalent to KEEPTTL in the Valkey API.
ExpiryTypeGetEx
Bases: Enum
GetEx option: The type of the expiry.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
SEC = (0, Union[int, timedelta])
class-attribute
instance-attribute
Set the specified expire time, in seconds. Equivalent to EX in the Valkey API.
MILLSEC = (1, Union[int, timedelta])
class-attribute
instance-attribute
Set the specified expire time, in milliseconds. Equivalent to PX in the Valkey API.
UNIX_SEC = (2, Union[int, datetime])
class-attribute
instance-attribute
Set the specified Unix time at which the key will expire, in seconds. Equivalent to EXAT in the Valkey API.
UNIX_MILLSEC = (3, Union[int, datetime])
class-attribute
instance-attribute
Set the specified Unix time at which the key will expire, in milliseconds. Equivalent to PXAT in the Valkey API.
PERSIST = (4, Type[None])
class-attribute
instance-attribute
Remove the time to live associated with the key. Equivalent to PERSIST in the Valkey API.
InfoSection
Bases: Enum
INFO option: a specific section of information:
When no parameter is provided, the default option is assumed.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
ALL = 'all'
class-attribute
instance-attribute
Return all sections (excluding module generated ones)
CLIENTS = 'clients'
class-attribute
instance-attribute
Client connections section
CLUSTER = 'cluster'
class-attribute
instance-attribute
Valkey Cluster section
CLUSTER_INFO = 'cluster_info'
class-attribute
instance-attribute
Valkey Cluster information.
Since: Valkey 9.1.0.
COMMAND_STATS = 'commandstats'
class-attribute
instance-attribute
Valkey command statistics
CPU = 'cpu'
class-attribute
instance-attribute
CPU consumption statistics
DEFAULT = 'default'
class-attribute
instance-attribute
Return only the default set of sections
ERROR_STATS = 'errorstats'
class-attribute
instance-attribute
Valkey error statistics
EVERYTHING = 'everything'
class-attribute
instance-attribute
Includes all and modules
KEYSPACE = 'keyspace'
class-attribute
instance-attribute
Database related statistics
LATENCY_STATS = 'latencystats'
class-attribute
instance-attribute
Valkey command latency percentile distribution statistics
MEMORY = 'memory'
class-attribute
instance-attribute
Memory consumption related information
MODULES = 'modules'
class-attribute
instance-attribute
Modules section
PERSISTENCE = 'persistence'
class-attribute
instance-attribute
RDB and AOF related information
REPLICATION = 'replication'
class-attribute
instance-attribute
Master/replica replication information
SENTINEL = 'sentinel'
class-attribute
instance-attribute
Valkey Sentinel section (only applicable to Sentinel instances)
SERVER = 'server'
class-attribute
instance-attribute
General information about the server
STATS = 'stats'
class-attribute
instance-attribute
General statistics
ExpireOptions
Bases: Enum
EXPIRE option: options for setting key expiry.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
HasNoExpiry = 'NX'
class-attribute
instance-attribute
Set expiry only when the key has no expiry (Equivalent to "NX" in Valkey).
HasExistingExpiry = 'XX'
class-attribute
instance-attribute
Set expiry only when the key has an existing expiry (Equivalent to "XX" in Valkey).
NewExpiryGreaterThanCurrent = 'GT'
class-attribute
instance-attribute
Set expiry only when the new expiry is greater than the current one (Equivalent to "GT" in Valkey).
NewExpiryLessThanCurrent = 'LT'
class-attribute
instance-attribute
Set expiry only when the new expiry is less than the current one (Equivalent to "LT" in Valkey).
UpdateOptions
Bases: Enum
Options for updating elements of a sorted set key.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
267 268 269 270 271 272 273 274 275 276 | |
LESS_THAN = 'LT'
class-attribute
instance-attribute
Only update existing elements if the new score is less than the current score.
GREATER_THAN = 'GT'
class-attribute
instance-attribute
Only update existing elements if the new score is greater than the current score.
ExpirySet
SET option: Represents the expiry type and value to be executed with "SET" command.
Attributes:
| Name | Type | Description |
|---|---|---|
cmd_arg |
str
|
The expiry type. |
value |
str
|
The value for the expiry type. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
set_expiry_type_and_value(expiry_type, value)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expiry_type
|
ExpiryType
|
The expiry type. |
required |
value
|
Optional[Union[int, datetime, timedelta]]
|
The value of the expiration type. The type of expiration determines the type of expiration value: |
required |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
ExpiryGetEx
GetEx option: Represents the expiry type and value to be executed with "GetEx" command.
Attributes:
| Name | Type | Description |
|---|---|---|
cmd_arg |
str
|
The expiry type. |
value |
str
|
The value for the expiry type. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
set_expiry_type_and_value(expiry_type, value)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expiry_type
|
ExpiryType
|
The expiry type. |
required |
value
|
Optional[Union[int, datetime, timedelta]]
|
The value of the expiration type. The type of expiration determines the type of expiration value: |
required |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
FlushMode
Bases: Enum
Defines flushing mode for:
FLUSHALL command and FUNCTION FLUSH command.
See FLUSHALL and FUNCTION-FLUSH for details
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
411 412 413 414 415 416 417 418 419 420 421 422 | |
FunctionRestorePolicy
Bases: Enum
Options for the FUNCTION RESTORE command.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
APPEND = 'APPEND'
class-attribute
instance-attribute
Appends the restored libraries to the existing libraries and aborts on collision. This is the default policy.
FLUSH = 'FLUSH'
class-attribute
instance-attribute
Deletes all existing libraries before restoring the payload.
REPLACE = 'REPLACE'
class-attribute
instance-attribute
Appends the restored libraries to the existing libraries, replacing any existing ones in case of name collisions. Note that this policy doesn't prevent function name collisions, only libraries.
ClientPauseMode
Bases: Enum
Mode option for the CLIENT PAUSE command.
See CLIENT PAUSE for details.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
443 444 445 446 447 448 449 450 451 452 453 454 | |
ALL = 'ALL'
class-attribute
instance-attribute
Pause all client commands.
WRITE = 'WRITE'
class-attribute
instance-attribute
Pause client write commands.
MigrateOptions
dataclass
Optional arguments for the migrate command.
See valkey.io for details.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/core_options.py
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |