Skip to content

Commit 5a466b9

Browse files
committed
refactor(plugin-redis): paginate namespace browse and drop dead code (#1701)
1 parent 1407abe commit 5a466b9

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- The table structure view has a Triggers tab for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, libSQL, and Cloudflare D1. It lists each trigger with its timing and event (plus enabled state where the engine reports it), with a filter field and sortable columns. Selecting a trigger shows its full definition in a read-only syntax-highlighted viewer. (#1695)
1313
- Traditional Chinese (繁體中文) language in Settings > General with full UI translation
1414

15+
### Changed
16+
17+
- Selecting a Redis namespace in the sidebar key tree now filters the open database view to that prefix, with paging, instead of opening a separate tab limited to one batch of keys. (#1701)
18+
1519
### Fixed
1620

1721
- Redis entries no longer disappear after the connection sits idle. The health check was running `SELECT 1`, which on Redis switches the active database, so a later refresh scanned the wrong database. (#1701)

Plugins/RedisDriverPlugin/RedisPluginDriver.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ final class RedisPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
3333

3434
private static let logger = Logger(subsystem: "com.TablePro.RedisDriver", category: "RedisPluginDriver")
3535

36-
private static let maxScanKeys = PluginRowLimits.emergencyMax
3736
static let maxKeyBrowseScan = 10_000
3837

3938
var serverVersion: String? {

TablePro/Views/Main/Extensions/MainContentCoordinator+Navigation.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,7 @@ extension MainContentCoordinator {
552552
// MARK: - Redis Key Tree Navigation
553553

554554
func browseRedisNamespace(_ prefix: String) {
555-
let separator = connection.additionalFields["redisSeparator"] ?? ":"
556-
let escapedPrefix = prefix
557-
.replacingOccurrences(of: "\\", with: "\\\\")
558-
.replacingOccurrences(of: "\"", with: "\\\"")
559-
let query = "KEYBROWSE MATCH \"\(escapedPrefix)*\" LIMIT 1000 OFFSET 0"
560-
let title = prefix.hasSuffix(separator) ? String(prefix.dropLast(separator.count)) : prefix
561-
tabManager.addTab(initialQuery: query, title: title)
562-
runQuery()
555+
applyBrowseSearch(BrowseSearchState(pattern: "\(prefix)*"))
563556
}
564557

565558
func openRedisKey(_ keyName: String, keyType: String) {

0 commit comments

Comments
 (0)