> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-ai-sql-walkthroughs.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

# Redis Connections

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, JSON).

## 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**: Keys grouped by separator (default `:`) in sidebar tree. `user:1`, `user:2` appear under `user` folder. Multi-level nesting supported (e.g., `app:cache:session:1`). Change 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-ai-sql-walkthroughs/Bj1EoTflf_jG6N_3/images/redis-key-browser.png?fit=max&auto=format&n=Bj1EoTflf_jG6N_3&q=85&s=0e76c8e7f07bc3625f50a29f974a9adf" 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-ai-sql-walkthroughs/Bj1EoTflf_jG6N_3/images/redis-key-browser-dark.png?fit=max&auto=format&n=Bj1EoTflf_jG6N_3&q=85&s=8ea3d31ccd14b66c2e76c70b24f1a079" 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**: String (plain text), Hash (key-value rows), List (with index), Set (individual rows), Sorted Set (with scores), JSON (syntax-highlighted).

**TTL Management**: View TTL for each key. `-1` = no expiration, `-2` = doesn't exist. Update TTL directly from interface.

**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 one value type (String, Hash, List, Set, Sorted Set, Stream). Matching runs server-side with `SCAN MATCH` and `SCAN TYPE` across the whole keyspace, scanning up to 10,000 matching keys; a truncation indicator appears when more exist. Filtering by key value or TTL is not supported, since Redis has no server-side primitive for it.

**Redis CLI** (execute commands directly):

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

-- Hash operations
HGETALL myhash
HSET myhash field1 "value1"
HDEL myhash field1

-- List operations
LRANGE mylist 0 -1
LPUSH mylist "item1" "item2"
LLEN mylist

-- Set operations
SMEMBERS myset
SADD myset "member1" "member2"
SCARD myset

-- Sorted set operations
ZRANGE myzset 0 -1 WITHSCORES
ZADD myzset 1 "one" 2 "two"
ZCARD myzset

-- Scan for keys
SCAN 0 MATCH user:* COUNT 100

-- Server info
PING
INFO
DBSIZE
```

Every command passes through to the server as-is, including ones TablePro does not recognize; only the result formatting is type-aware.

## 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.

**Limitations**: Cluster mode unsupported, Pub/Sub and Streams limited in grid (work in CLI), large keys paginated.

**Performance**: Use namespace browsing for filtering, use `SCAN` instead of `KEYS` in CLI, check memory with `INFO memory`.
