Skip to content

feat(plugin-redis): native key-pattern search for key browsing#1657

Merged
datlechin merged 2 commits into
mainfrom
fix/redis-key-pattern-search
Jun 11, 2026
Merged

feat(plugin-redis): native key-pattern search for key browsing#1657
datlechin merged 2 commits into
mainfrom
fix/redis-key-pattern-search

Conversation

@datlechin

Copy link
Copy Markdown
Member

Problem

Applying a filter on a Redis connection did nothing useful. Redis is a key-value store, but it was served the SQL-style column / operator / value filter row, which has no Redis equivalent:

  1. Filters on Type, TTL, or Value (and any multi-filter combo) silently fell back to an unfiltered SCAN 0 MATCH "*".
  2. Even a Key filter ran a single ~200-slot SCAN batch and never iterated the keyspace, so most matches were missed.

What this does

Replaces the SQL filter row, for Redis only, with a native key-pattern search field plus a key-type scope bar (the RedisInsight / redis-cli convention, and the HIG search-field + scope-bar pattern). Filtering now runs server-side and correctly:

  • Key pattern uses Redis glob syntax (user:*, ?, [ae]), case-sensitive, passed verbatim to SCAN MATCH.
  • Type scope maps to SCAN TYPE (string, hash, list, set, zset, stream).
  • The browse executor iterates the full SCAN cursor (dedup, 10,000-key cap, truncation flag) instead of one batch.

The search criteria persist in the query string and per-table state, so refresh, pagination, and tab restore all re-run the correct query. A user-typed SCAN in the editor still behaves as a single-batch command.

TTL and Value filtering are dropped for Redis: there is no server-side primitive for them, and they never worked in the old filter row.

Plugin-declared, not hardcoded

The filter UI is chosen by a new BrowseFilterDescriptor that a driver returns via the optional PluginBrowseFilterProvider protocol (mirrors the existing defaultSortHint pattern). nil means the SQL filter row, the default for every existing driver. This lets other non-SQL plugins (DynamoDB, Cassandra, Etcd) opt into their own filter UI later.

ABI

The new PluginKit file is purely additive (new symbols only), so this needs the abi-additive label and no currentPluginKitVersion bump. Redis is a bundled plugin, so the fix ships with the next app release; no registry re-release.

Tests

  • RedisQueryBuilderTests: KEYBROWSE generation for raw glob, type scope, combined, command-string quoting, and base-SCAN fallback.
  • TabFilterStateTests: browseSearch accessor, active-state logic, and back-compat decoding of legacy JSON without the new fields.

Notes

  • Localizable.xcstrings is intentionally not included. A background Xcode build regenerated it mid-work and mixed the new keys with unrelated in-flight strings; the catalog regenerates cleanly on a full build, and String(localized:) falls back to the literal until then.

@datlechin datlechin added the abi-additive PluginKit ABI diff reviewed as additive; no version bump needed label Jun 11, 2026
@mintlify

mintlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Jun 11, 2026, 5:35 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@datlechin datlechin merged commit a5a2053 into main Jun 11, 2026
4 of 5 checks passed
@datlechin datlechin deleted the fix/redis-key-pattern-search branch June 11, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abi-additive PluginKit ABI diff reviewed as additive; no version bump needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant