Help › Explore a database

Run Redis commands in a query tab

Run Redis commands as redis-cli takes them, see replies as rows, and know which commands Querlyn asks about or refuses.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

A query tab on a Redis connection takes Redis commands, written as you would type them into redis-cli. Querlyn sends each command as you wrote it and shows the reply in the results grid.

To open one, right-click the connection in the sidebar and choose Query › New Query on This Connection. The same command on a numbered database under Databases opens a tab that starts in that database. ⌘↩ on macOS or Ctrl+Enter on Windows and Linux runs the command at the cursor.

Write commands

SET session:42 "{\"user\": 7}" EX 3600
HGETALL user:7
# a line that starts with # is a comment
SCAN 0 MATCH user:* COUNT 100
  • One command on each line. Run a selection to run several in order; a command that fails stops the ones after it.
  • Arguments are separated by spaces. Quote an argument that has spaces. In double quotes, \n, \r, \t, \\, \" and \x with two hex digits (any byte) are read; in single quotes only \'.
  • Command names are in any case.

The editor completes command names, a command's subcommands and the words it takes, each with the command's arguments beside it. It underlines a quote that is not closed, a command with too few arguments, a command Querlyn does not know and a command it does not send.

The toolbar's Database button shows the numbered database the tab's commands run in, and its menu moves the tab to another. SELECT in the editor moves the tab too, and the button follows.

Read replies

ReplyIn the grid
A valueOne row with one cell; OK shows as the statement's outcome
A list or a setA row for each item
A hash, or any reply of fields and valuesA row for each field
A list of lists of one length (members with scores, stream entries)A column for each position
Anything nested deeperJSON in its cell
INFORows of section, name and value

A value that is not text is shown as bytes, never altered. An error is the server's own, with what it means where that helps: a key of the wrong type, a user who may not run the command.

What Querlyn asks about

Querlyn judges each command from its own table of Redis commands. The table has Redis's own commands and those of the JSON, search (FT.), time series (TS.) and Bloom and cuckoo filter (BF., CF.) modules.

CommandWhat happens
Commands that lose data or disturb the server: FLUSHALL, FLUSHDB, SWAPDB, SHUTDOWN, DEBUG, CONFIG SET, SCRIPT FLUSH, FUNCTION FLUSH, ACL SETUSER, REPLICAOF, MIGRATE, FT.DROPINDEX, FT.CONFIG SET, cluster changes and the likeAsked about wherever the connection asks before destructive statements, with what is lost
Every command that writes (SET, DEL, HSET, EXPIRE, …)Asked about on a Production connection
EVAL, EVALSHA, FCALL and commands Querlyn does not knowQuerlyn cannot tell what they change: asked about on a Production connection, and refused on a read-only connection
KEYSRuns, with a warning: it looks at every key and holds the server up until it is done. On a Production connection Querlyn asks first. SCAN reads the same keys a page at a time, and so does a keys tab

A read-only connection runs only commands Querlyn knows to read; see Make a connection read-only.

Redis has no transactions to roll back. MULTI queues the commands that follow and EXEC applies them together; each queued command is checked when you run it.

When several commands of a selection need confirmation, the question lists each with its number in the selection.

On a cluster

A command goes to the node that serves its keys, whichever node the connection names, and follows where the cluster sends it while keys move between nodes.

  • Keys of one command must be in one slot. A cluster runs MGET, DEL, RENAME and other commands with several keys only when all the keys hash to the same slot. Querlyn checks before it sends: a command whose keys are in different slots is refused with the two keys and their slots, and nothing reaches the server. Keys that share a tag in braces are in one slot: {user:7}:cart and {user:7}:orders.
  • A command without a key goes to the node the connection names, and a message with its result names that node. SCAN, KEYS, DBSIZE, INFO, FLUSHDB and FLUSHALL are about that one node; a keys tab scans every node.
  • A transaction stays on one node. MULTI is held and sent together with the command that follows it, to that command's node. Every command up to EXEC or DISCARD goes there. WATCH before MULTI chooses the node the same way. A key of another node inside the transaction is refused by the server.
  • A command Querlyn does not know has no keys it can see: it goes to the node the connection names and follows the cluster's redirection from there.

Commands that wait, and commands Querlyn does not send

A command that waits on the server, such as BLPOP or XREAD with BLOCK, runs until something arrives or its time passes. Query › Cancel Query ends it: Querlyn stops waiting and drops the tab's connection to the server, and opens a new one, in the same database, when the tab is next used. A command the server is already working on, such as KEYS on a large database, finishes there.

Querlyn does not send commands that never end or that would change the connection under it, and says why: MONITOR, SUBSCRIBE, PSUBSCRIBE and SSUBSCRIBE, SYNC and PSYNC, HELLO, RESET, QUIT and CLIENT REPLY.

Passwords in commands

A command that carries a password (AUTH, CONFIG SET requirepass, ACL SETUSER with a password, MIGRATE with AUTH) runs as written, but the password is left out of the statement console and the query history keeps no text of the command.

Help for Querlyn 0.1.0. All help topics