feat(web-console): Add column name search to Schema filter#476
feat(web-console): Add column name search to Schema filter#476emrberk merged 2 commits intoquestdb:feat/schema-column-filterfrom
Conversation
|
Hi @emrberk Hope y are having a great day, For schemas with many tables, this could avoid repeated Redux store lookups. But while working on the issue, going through the repo, I found that ithis would be unnecessary tbh. As the Also my current implementation uses |
|
|
||
| useEffect(() => { | ||
| if (state.view === View.ready) { | ||
| let isCancelled = false; |
There was a problem hiding this comment.
while testing i found a bug , When rapidly backspacing through search text, I encountered a race condition where tables would incorrectly stay expanded even after clearing the search.
Ig the useEffect triggers async fetchColumns() promises for each query change. When typing/deleting rapidly, multiple effect instances run concurrently, like
Type "uuid" → fetch starts → backspace fast → new fetch starts → old fetch completes → incorrectly sets isExpanded=true
The stale fetch promises would resolve AFTER newer queries, incorrectly modifying the tree state.
Thats why i add this effect cleanup with a cancellation flag.....so when the effect re-runs (on rapid input), the cleanup function marks the previous effect as cancelled. Any async operations from the old effect that complete later will skip their state updates, preventing ghost expansions.
There was a problem hiding this comment.
Hey @Itz-Agasta, we will add this feature to the next release, I added a new commit to change the handling of columns and symbol details. You can take a look at it. This race condition should be removed now.
I am merging this to a branch to trigger the CI.
Thanks for your contribution!
Enhanced the table filter in the Schema panel to search both
table names&column names. When a column matches the search query, the table automatically expands (in-memory only) to show the matching columns.Changes
allColumnsdataisCancelledflag) to prevent stale async operations from causing incorrect expansion states during rapid input changesImplementation Details
allColumnsfrom Redux store (already fetched viainformation_schema.columns()) - no additional network requeststablesWithColumnMatchesSet: Computed viauseMemoto track which tables need auto-expansionnode.isExpanded = truedirectly on tree nodes without callingsetSectionExpanded()(localStorage)Behavior
Testing
Tested with sample tables containing columns like
col_string,col_ts,sensor_id:2025-10-01.20-35-11.mp4
Closes #363