Skip to content

Command String Arguments

Valkey strings are stored in its simplest form: as a sequence of bytes. GLIDE offers GlideString which maps to Valkey strings. Use it to pass Valkey strings as arguments to commands, or receive Valkey strings in response to commands. GlideString represents either:

  1. string: as a UTF-8 encoded string.
  2. Buffer: as a byte[].

The return types of command API:

  • Command uses string instead of GlideString as the return type if it contains a simple string value (simple strings in Valkey are always UTF-8 encoded strings). For example, type command returns one of pre-defined strings, or set command which returns "OK".
  • Command uses Buffer as the return type, because it always contains binary data. For example, dump and functionDump commands.
  • Most commands use GlideString as the common return type.