Value formats

functional

View a value as UTF-8, JSON, hex, or MessagePack, with your pick remembered for the session.

The value viewer can show a value in the format you choose instead of only the one it detects. Open a value - Open Value on a Redis key and then Open in Value Viewer… or View as Hex… on its result cell, or Preview Payload in the Pub/Sub viewer - and use the format picker in the viewer's toolbar:

  • Auto - the detected view (JSON, XML, image, geometry, or text).
  • UTF-8 - the bytes as text; invalid UTF-8 is shown with replacement characters and a note saying so.
  • JSON - pretty-printed with the tree view; a value that is not valid JSON keeps its raw text with a note.
  • Hex - the canonical hex dump.
  • MessagePack - decoded to JSON for the tree and highlighter. Binary fields show as {"$binary": "<hex>"}, standard timestamps as {"$timestamp": "2023-11-14T22:13:20Z"}, other extension values as {"$ext": {"type": n, "data": "<hex>"}}, and a map whose keys would collide as JSON object keys (an integer 1 next to the string "1", or a repeated key) as {"$map": [[key, value], …]} so no entry is lost. A payload that is not valid MessagePack falls back to the hex dump with the decoder's reason.

Binary cells also get the picker in the Cell Details panel's hex view and in the viewer it opens, so a MessagePack value in any binary column can be decoded the same way.

The MessagePack decoder treats the payload as untrusted. Lengths in the data are checked against the bytes actually present, so a truncated or hostile payload is reported as not decodable instead of exhausting memory, and nesting deeper than 128 levels is refused.

For a Redis key read (GET, HGETALL, LRANGE, JSON.GET…) opened from a result cell, the choice is remembered for that connection, database, key and column, and it survives restarting SQLly: the key's value comes back in the format you picked whichever tab or row shows it. The choices are kept in value-formats.json in SQLly's data folder, which holds the 2,000 most recently chosen keys; older ones are forgotten first. If that file cannot be read, SQLly leaves it untouched, says so under the viewer's toolbar, and keeps your new choices for this session only. Other result cells remember the choice for that query, row and column until SQLly quits. Choosing Auto forgets it. Values over 1 MB keep the detected view only.

SQLly
Value viewer format picker: a MessagePack-encoded Redis value decoded into the JSON tree.
Value viewer format picker: a MessagePack-encoded Redis value decoded into the JSON tree.