> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-721-compare-sync.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Redis

> Browse keys by namespace, manage TTLs, and run Redis commands directly from the editor

TablePro connects to standalone Redis servers with hiredis. Keys are grouped by colon-separated namespaces in the sidebar. Values display with type-aware formatting in the data grid (strings, hashes, lists, sets, sorted sets, streams).

## Quick Setup

<Steps>
  <Step title="Create Connection">
    Click **New Connection**, select **Redis**, enter host/port/password/database, and click **Create**
  </Step>

  <Step title="Test Connection">
    Click **Test Connection** to verify
  </Step>
</Steps>

## Connection Settings

| Field              | Default     | Notes                                                                                  |
| ------------------ | ----------- | -------------------------------------------------------------------------------------- |
| **Host**           | `localhost` |                                                                                        |
| **Port**           | `6379`      |                                                                                        |
| **Username**       | -           | Redis 6 ACL user, sent as `AUTH username password`. Leave empty for `requirepass` auth |
| **Password**       | -           | Leave empty for local dev                                                              |
| **Database Index** | `0`         | 0-15 stepper, in the Advanced section                                                  |
| **Key Separator**  | `:`         | Groups keys by prefix in sidebar (Advanced)                                            |

<Tip>
  Open URLs like `redis://:password@host:6379/0` or `rediss://` (TLS) from your browser. See [Connection URL Reference](/databases/connection-urls#redis).
</Tip>

## Amazon ElastiCache (IAM)

Set **Authentication** to an AWS IAM mode (Access Key, Profile, or SSO) to connect to an IAM-enabled ElastiCache cache. TablePro generates a short-lived IAM auth token and uses it as the Redis password; the username is your IAM-enabled Redis user. Enter the AWS region and the cache name (replication group ID), and enable TLS, which ElastiCache IAM requires. Profiles resolve from `~/.aws/config` and `~/.aws/credentials`, including `credential_process`, SSO, and assumed roles.

## SSL/TLS

Configure in the **SSL/TLS** pane of the connection form. Managed services like Upstash and Redis Cloud require TLS. Use `rediss://` for URL imports.

| Mode                       | hiredis behavior                   | Use for                                          |
| -------------------------- | ---------------------------------- | ------------------------------------------------ |
| **Disabled**               | Plain TCP                          | Local dev                                        |
| **Preferred**              | TLS, do not verify peer            | Same as Required on Redis (there is no fallback) |
| **Required (skip verify)** | TLS, do not verify peer            | Self-signed certs, Upstash, untrusted CAs        |
| **Verify CA**              | TLS, verify peer with your CA cert | Private PKI; supply CA path                      |
| **Verify Identity**        | Same as Verify CA                  | No separate hostname check on Redis              |

For untrusted-CA endpoints (Upstash, internal load balancers), pick **Required (skip verify)**. For private CA setups, pick **Verify CA** and provide the CA certificate path. SNI is sent for every TLS mode; Verify Identity adds nothing over Verify CA on Redis.

## Features

**Namespace Browsing**: The sidebar groups keys by separator (default `:`). `user:1` and `user:2` appear under a `user` folder, and nesting goes as deep as the key does (`app:cache:session:1`). Change the separator in Advanced settings.

<Frame caption="Keys grouped by namespace with type-aware values">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-feat-721-compare-sync/Px1jOVnHwSdgRuFN/images/redis-key-browser.png?fit=max&auto=format&n=Px1jOVnHwSdgRuFN&q=85&s=596a1d56de194ad67af2ec91b1f63651" alt="Redis keys grouped by namespace in the sidebar with values in the data grid" width="1560" height="960" data-path="images/redis-key-browser.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-feat-721-compare-sync/Px1jOVnHwSdgRuFN/images/redis-key-browser-dark.png?fit=max&auto=format&n=Px1jOVnHwSdgRuFN&q=85&s=89ecb94a52ae04e6db2ed9ccf43d61bb" alt="Redis keys grouped by namespace in the sidebar with values in the data grid" width="1560" height="960" data-path="images/redis-key-browser-dark.png" />
</Frame>

**Key-Value Viewing**: The grid has **Key**, **Type**, **TTL**, and **Value** columns. The Value column previews the key: strings as text, hashes as a JSON object, lists and sets as a JSON array, sorted sets as `member:score` pairs, streams as the newest 5 entries. Previews are cut off at 1,000 characters. Only a string Value cell can be edited in the grid; change the other types in the CLI.

**TTL Management**: The TTL column shows seconds to expiry. `-1` means no expiration, `-2` means the key does not exist. Edit the cell to run `EXPIRE`, or set it to `-1` to run `PERSIST`.

**Key Filtering**: Toggle the filter bar to search keys by pattern. Patterns use Redis glob syntax (`*` matches any sequence, `?` matches one character, `[ae]` matches a character set) and are case-sensitive, the same as `redis-cli`.

* The type scope narrows results to String, Hash, List, Set, Sorted Set, or Stream.
* Matching runs server-side with `SCAN MATCH` and `SCAN TYPE`, and stops after 10,000 matching keys.
* Filtering by key value or TTL is not supported, since Redis has no server-side primitive for it.

**Redis CLI**: Each statement is one Redis command. To run several in one go, separate them with `;`. TablePro passes each command through as-is, including commands it does not recognize; only the result formatting is type-aware. Redis has no comment syntax, and TablePro does not strip comments, so a `--` or `#` line inside a statement is sent to the server and fails.

The blocks below list one command per line for reference.

Key operations:

```redis theme={null}
GET mykey
SET mykey "hello" EX 60
DEL mykey key2 key3
KEYS user:*
```

Hash, list, set, and sorted set operations:

```redis theme={null}
HGETALL myhash
HSET myhash field1 "value1"
LRANGE mylist 0 -1
LPUSH mylist "item1" "item2"
SMEMBERS myset
SADD myset "member1" "member2"
ZRANGE myzset 0 -1 WITHSCORES
ZADD myzset 1 "one" 2 "two"
```

Scanning and server info:

```redis theme={null}
SCAN 0 MATCH user:* COUNT 100
PING
INFO
DBSIZE
```

## Troubleshooting

**Connection refused**: Check Redis is running (`brew services start redis`), verify correct port in `redis.conf`, check `bind` directive.

**Auth failed**: Verify password matches `requirepass` in `redis.conf`. For Redis 6.0+ ACL: `ACL SETUSER myuser on >password ~* +@all`

**Timeout**: Verify host/port, check network and firewall, whitelist IP for cloud-hosted Redis.

**Slow key list**: `KEYS` blocks the server on a large keyspace. Browse by namespace instead, and use `SCAN` when you need a pattern match in the CLI. Check memory pressure with `INFO memory`.

## Limitations

* Cluster mode is not supported. Connect to a single node.
* Pub/Sub has no grid support. `PUBLISH` runs in the CLI, but there is no subscriber view.
* The grid previews a stream's newest 5 entries. Use `XRANGE` in the CLI for the rest.
* The sidebar key tree loads at most 50,000 keys, and key filtering scans at most 10,000 matching keys.
