Redis query tool
A Redis query tool is a terminal program that reads Redis keys. Redis is an in-memory data store that keeps values under keys. SQL (Structured Query Language) is the language a relational database runs, and this path does not accept it. The command-line interface (CLI) is the datatug program in a terminal. TugQL is DataTug's query language for collections and joins, and this path does not run it. An ACL (Access Control List) is the Redis permission list on the identity you connect with. TLS (Transport Layer Security) is the encryption a rediss:// address checks. JSON (JavaScript Object Notation) is the text format the command prints. GET reads one key, MGET reads several keys, HGET reads one field of a hash, and HMGET reads several fields of a hash. A bounded metadata read returns a small fact about a key, not its whole value. A Web UI (user interface) is the browser and the hosted app, and this page does not claim that path. To query Redis from the CLI, DataTug runs native query redis reads. MongoDB is a document database with its own page. Redis direct CLI queries have been available since DataTug CLI 0.125.1.
The command the guide shows
The source guide is docs/query/redis.md at the CLI revision the supported databases catalogue cites. DataTug CLI is open source under the Apache License 2.0. The commands it shows are:
export REDIS_URL='rediss://reader:password@redis.example.com:6379/0'
datatug query redis --db env:REDIS_URL -- GET customer:42
datatug query redis --db env:REDIS_URL -- MGET customer:42 customer:43
datatug query redis --db env:REDIS_URL -- HMGET customer:42 name emailThe password in that example is the guide's placeholder. An environment variable holds the address, so the password is not a project file and not a shell argument of the query itself. The path in the address, /0 here, selects the numeric Redis database. Use rediss:// for verified TLS. The guide says redis:// is plaintext and suits a trusted local connection. Use a read-only Redis ACL identity. The guide also says to use a dedicated ACL user limited to the key patterns and reads you intend. The -- before the command keeps a key that begins with a dash from being read as a flag.
What the read returns
GET, MGET, HGET and HMGET return JSON. The guide says strings for GET and HGET, ordered arrays for MGET and HMGET, integers for metadata, and null when the value is absent. A wrong type, an ACL denial, or a connection failure exits with a nonzero status. The guide says addresses, passwords and server errors are left out of the diagnostics. Redis values are strings, so the guide says this command suits text data.
Bounded metadata reads are the smaller questions. The guide names HEXISTS, EXISTS, TYPE, TTL, PTTL, STRLEN, HLEN, LLEN, SCARD and ZCARD. Those commands answer whether a key or hash field exists, what type a key has, how long it lives, or how many items a string, hash, list, set or sorted set holds. They are not a way to list every key.
| Question | What the CLI does |
|---|---|
| Address | rediss:// for verified TLS, or plaintext redis:// for a trusted local connection. A read-only ACL identity. |
| Query | Native query redis reads, since CLI 0.125.1. SQL and TugQL are unavailable. |
| Reads | GET, MGET, HGET, HMGET, and the bounded metadata reads named above. The result is JSON. |
| Bounds | A ten-second deadline and a 1 MiB (mebibyte) reply cap. |
| Browser and hosted app | Not verified by this catalogue. |
Deadline and size
Calls have a ten-second deadline and a 1 MiB reply cap. The guide adds two earlier limits: at most 128 key or field arguments, and 64 KiB (kibibytes) of command text. It says each complete Redis reply is capped at 1 MiB before the driver allocates that reply. A larger reply fails and closes that connection. A later query connects again.
Browser and hosted use
Browser and hosted availability are unverified. The catalogue's Web UI cell for Redis reads "Not verified by this catalogue". This page does not claim the browser or the hosted app can query Redis. A local CLI check does not establish that path.
MongoDB and the catalogue
MongoDB query tool CLI is the document-database path from the same release. It runs TugQL through query run, and it does not read Redis keys. Query Firestore with SQL is the other document path, and it also rejects SQL. The SQL CLI tool page is the terminal program. Install it from the installer.
The current reviewed catalogue release is DataTug CLI 0.136.1. Redis direct CLI queries have been available since DataTug CLI 0.125.1. The supported databases catalogue is the operation-by-operation list, and the Redis row stays at #redis.
