Skip to content

Schema: enhance table filter to search table and column names with safe in-memory auto-expansion - #477

Closed
HVbajoria wants to merge 1 commit into
questdb:mainfrom
HVbajoria:main
Closed

HVbajoria wants to merge 1 commit into
questdb:mainfrom
HVbajoria:main

Conversation

@HVbajoria

Copy link
Copy Markdown

Description

Enhanced the table filter in the Schema panel to search both table names and column names. When a column matches the search query, the table automatically expands (in-memory only) to show the matching columns.

Changes

  • Filter logic: Updated table filtering to include column name matches using existing Redux allColumns data.
  • Auto-expansion: Tables with matching columns now auto-expand their table row AND columns folder during search.
  • State management: Search-driven expansions are purely in-memory and never persist to localStorage.
  • Race condition fix: Added cleanup mechanism (isCancelled flag) to prevent stale async operations from causing incorrect expansion states during rapid input changes.

Implementation Details

  • Column matching: Uses allColumns from the Redux store (already fetched via information_schema.columns()); no additional network requests.
  • tablesWithColumnMatches Set: Computed via useMemo to track which tables need auto-expansion.
  • In-memory expansion: Sets node.isExpanded = true directly on tree nodes without calling setSectionExpanded() (which writes to localStorage).
  • Async safety: Effect cleanup function prevents race conditions when users type/delete rapidly.

Behavior

  • Search for table name → table stays collapsed (existing behavior preserved).
  • Search for column name → table + columns auto-expand, matching columns are visible.
  • Clear search → all expansions revert to localStorage state (user’s manual expansions preserved).
  • Rapid typing/backspace → no ghost expansions.

Testing

Tested with sample tables containing columns like col_string, col_ts, sensor_id:

  • Column search correctly expands matching tables.
  • Table name search maintains collapsed state.
  • Rapid input (backspace spam) correctly handles state without stale expansions.
  • Clearing search restores previous expansion states.

Video

Screen.Recording.2025-10-02.at.1.05.57.AM.mp4

@CLAassistant

CLAassistant commented Oct 1, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@HVbajoria

HVbajoria commented Oct 1, 2025 •

Copy link
Copy Markdown
Author

Resolves #331

@puzpuzpuz

Copy link
Copy Markdown
Contributor

cc @emrberk

@emrberk

emrberk commented Oct 3, 2025

Copy link
Copy Markdown
Member
  • PR title and description does not match
  • Video and the code is telling something different
  • The solution is not feasible

Closing the PR as it's overly AI-driven and unrefined.

@emrberk emrberk closed this Oct 3, 2025
@HVbajoria

Copy link
Copy Markdown
Author

Sorry for the issue @emrberk

Should I create one more PR with proper details.

Since, t was my first time creating a detailed PR thought of using AI for it.

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.

4 participants