Skip to content

Update table view for nosql dbs#201

Merged
husamql3 merged 3 commits into
stagefrom
update-table-view-for-nosql-dbs
May 16, 2026
Merged

Update table view for nosql dbs#201
husamql3 merged 3 commits into
stagefrom
update-table-view-for-nosql-dbs

Conversation

@husamql3
Copy link
Copy Markdown
Owner

@husamql3 husamql3 commented May 16, 2026

Summary by CodeRabbit

  • New Features

    • Added Redis database support with full read/write capabilities and document-style table views
    • Improved schemaless table handling for better data exploration
  • Bug Fixes

    • Fixed hostname typos in development URLs (dbstuio → dbstudio)
    • Enhanced connection error handling for improved reliability
  • Documentation

    • Updated setup guides with Redis initialization instructions
    • Released version 1.9.3 with changelog updates

Review Change Stack

@husamql3 husamql3 merged commit 433a19c into stage May 16, 2026
0 of 5 checks passed
@husamql3 husamql3 deleted the update-table-view-for-nosql-dbs branch May 16, 2026 18:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4dba9a83-9f7e-43c5-97a2-d2bf975e2165

📥 Commits

Reviewing files that changed from the base of the PR and between 49a7770 and f0906e0.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (31)
  • AGENTS.md
  • README.md
  • package.json
  • packages/server/package.json
  • packages/server/src/adapters/base.adapter.ts
  • packages/server/src/adapters/connections.ts
  • packages/server/src/adapters/redis/redis.adapter.ts
  • packages/server/src/adapters/redis/redis.command-shaper.ts
  • packages/server/src/adapters/register.ts
  • packages/server/src/db-manager.ts
  • packages/server/src/utils/create-server.ts
  • packages/server/tests/adapters/redis/redis.adapter.databases.test.ts
  • packages/server/tests/adapters/redis/redis.adapter.errors.test.ts
  • packages/server/tests/adapters/redis/redis.adapter.query.test.ts
  • packages/server/tests/adapters/redis/redis.adapter.records.test.ts
  • packages/server/tests/adapters/redis/redis.adapter.scan.test.ts
  • packages/server/tests/adapters/redis/redis.adapter.tables.test.ts
  • packages/shared/src/constants/defaults.ts
  • packages/shared/src/types/database.types.ts
  • packages/web/src/components/sidebar/sidebar-search-tables.tsx
  • packages/web/src/features/schema/components/schema-toolbar.tsx
  • packages/web/src/features/tables/components/header/table-header.tsx
  • packages/web/src/features/tables/components/table-document-view.tsx
  • packages/web/src/features/tables/components/table-footer.tsx
  • packages/web/src/features/tables/components/table-head-row.tsx
  • packages/web/src/features/tables/components/table-tab-container.tsx
  • packages/web/src/hooks/use-is-schemaless.ts
  • packages/web/vite.config.ts
  • scripts/init-db-redis.sh
  • www/src/components/footer.tsx
  • www/src/lib/content/changelog.ts

📝 Walkthrough

Walkthrough

This PR introduces Redis database support to db-studio, implementing a complete Redis adapter with SCAN-based data pagination, record mutations, command execution, and schemaless table handling in the web UI. Frontend components treat Redis similarly to MongoDB, disabling schema mutations and using a document-view layout.

Changes

Redis Database Support

Layer / File(s) Summary
Redis Client Infrastructure & Error Handling
packages/server/src/db-manager.ts, packages/server/src/adapters/base.adapter.ts, packages/server/src/adapters/connections.ts
Database manager now creates, caches, and manages ioredis clients per logical DB index with TLS/credential support, cluster-mode detection, and connection validation. Constructor wraps initialization with error capture. BaseAdapter maps Redis-specific errors (auth, busy, readonly, cluster) to HTTP 503.
RedisAdapter Class & Registration
packages/server/src/adapters/redis/redis.adapter.ts, packages/server/src/adapters/register.ts
Defines REDIS_TABLES constant (strings/hashes/lists/sets/zsets/streams), column schemas per table type, and RedisAdapter class extending BaseAdapter. Adapter rejects all schema mutations (create/delete table, add/delete/alter/rename columns) with HTTP 400. Database and table listing use Redis introspection commands (CONFIG GET, INFO).
Table Data Retrieval & SCAN Pagination
packages/server/src/adapters/redis/redis.adapter.ts (getTableData, hydrateRows, getCachedCounts)
getTableData implements forward-only SCAN with base64url-encoded cursor envelope including table/direction validation. Collects keys per Redis type, hydrates via pipelined reads (TTL + value), and returns paginated rows with metadata. getCachedCounts scans by TYPE per table with 30-second TTL caching.
Record Create/Update/Delete
packages/server/src/adapters/redis/redis.adapter.ts (addRecord, updateRecords, deleteRecords, writeRecord, writeCollectionValue)
addRecord creates keys with type-specific commands (SET NX, HSET, RPUSH, SADD, ZADD, XADD) and optional TTL. updateRecords rewrites values by primary key; rejects stream updates with 400. deleteRecords bulk-deletes; bulkInsertRecords aggregates per-record success/failure. writeCollectionValue coerces JSON inputs to Redis structures.
Query Parsing & Reply Shaping
packages/server/src/adapters/redis/redis.command-shaper.ts, packages/server/src/adapters/redis/redis.adapter.ts (executeQuery)
tokenizeCommand parses redis-cli-style input with quote/escape handling. shapeReply dispatches Redis replies (scalars, arrays, key-value pairs, zsets with scores, INFO sections, streams) into tabular {columns, rows, rowCount} form with fallback heuristics. executeQuery calls client.call, shapes reply, and returns errors as data rows.
Parsing & Conversion Helpers
packages/server/src/adapters/redis/redis.adapter.ts (helper functions)
Utilities for parsing INFO/keyspace output, extracting/validating key/ttl, JSON stringification/coercion of collection inputs, zset flat-pair conversion, and XINFO STREAM translation to adapter column format.
Frontend Schemaless Table Hook & Components
packages/web/src/hooks/use-is-schemaless.ts, packages/web/src/features/schema/components/schema-toolbar.tsx, packages/web/src/features/tables/components/header/table-header.tsx, packages/web/src/features/tables/components/table-head-row.tsx, packages/web/src/features/tables/components/table-tab-container.tsx, packages/web/src/components/sidebar/sidebar-search-tables.tsx, packages/web/src/features/tables/components/table-document-view.tsx, packages/web/src/features/tables/components/table-footer.tsx
New useIsSchemaless hook returns true for Redis. Frontend hides "Add Table" button, disables "Add Column" and delete-column actions, hides filter popup, and disables sort controls for Redis. Document-view layout renders for both MongoDB and Redis. TableFooter accepts variant prop to show "documents" instead of "rows".
Configuration, Documentation & Initialization
packages/server/package.json, package.json, packages/shared/src/constants/defaults.ts, packages/shared/src/types/database.types.ts, packages/web/vite.config.ts, AGENTS.md, README.md, scripts/init-db-redis.sh, www/src/lib/content/changelog.ts, www/src/components/footer.tsx
Version bump (1.9.2 → 1.9.3), portless config name corrected (api.db-studioapi.dbstudio), ioredis dependency added. Root package.json adds init-db:redis script. Typos corrected in defaults (dbstuiodbstudio). DATABASE_TYPES reformatted to multi-line with redis commented out. init-db-redis.sh initializes local Redis via Docker with sample data seeding across multiple data types and databases. Docs and changelog updated.
Redis Adapter Test Suites
packages/server/tests/adapters/redis/*
Comprehensive Vitest coverage: database listing and connection info extraction, table metadata and schema rejection, SCAN pagination with cursor validation and round-trip caps, data type hydration (hashes/lists/sets/zsets/streams), record mutations with type-specific command validation, command execution and reply shaping, tokenization with quote/escape handling, and error mapping (NOAUTH, WRONGPASS, BUSY, etc. → 503).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Possibly related PRs

  • husamql3/db-studio#118: Updates error handling in detectDbType() to throw on unsupported protocols, which overlaps with the current PR's commented-out Redis protocol detection and error capture pattern.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-table-view-for-nosql-dbs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant