Skip to content

feat(chen): find databases by name from the object search - #1993

Open
adriadam10 wants to merge 1 commit into
jumpserver:devfrom
adriadam10:feat/chen-find-databases
Open

adriadam10 wants to merge 1 commit into
jumpserver:devfrom
adriadam10:feat/chen-find-databases

Conversation

@adriadam10

Copy link
Copy Markdown
Contributor

Problem

The Objects search (catalogObjects with q) only looks for tables and views inside one database, and the search box is disabled until a database is selected. The database list itself is paged (100 per page, "Load more"), so on a server with a few hundred databases a database further down the list can only be reached by paging and scrolling; the browser's find (Ctrl+F) does not see the pages that are not loaded yet.

Change

  • While searching, the tree lists the databases whose name contains the search text above the matching tables/views. The remaining database pages are loaded when a search starts.
  • Clicking one of those databases closes the search, selects and expands it in the tree and scrolls to it.
  • The search box no longer requires a selected database (the database part works without one; the table search still needs it, and the existing hint is kept when nothing matches).
  • New i18n key Chen.GoV1FindTableOrDatabase for the placeholder.

Testing

  • oxfmt, oxlint, eslint, nuxt typecheck and vitest (the repository's pre-commit) pass.
  • Running on v5.2.1 against a MariaDB server with 254 databases.

The object search only looks inside one database and the database list is
paged, so a database further down the list could not be found. While
searching, the tree now also lists the databases whose name matches (it
loads the remaining pages first); clicking one closes the search and opens
it in the tree. The search box no longer needs a database to be selected.
@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

@ibuler ibuler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced four cases in GoCatalogTree.vue using the Vue component logic and a mocked catalog API. These should be addressed before merging.

  • [P2] Searching before the first database page arrives misses later pages. Type a query while the initial request is pending, with a match on page two. The first call to loadAllDatabases() exits, and finishing the initial request doesn't start pagination. The match only appears after the query is edited. Search watcher
  • [P2] Enter doesn't open a database search result. Move focus from the search field to a matching database with Arrow Down, then press Enter. The key handler toggles the node and leaves search open. Route keyboard activation through the same path as a click. Click handler · Enter handler
  • [P2] Clicking a result leaves it hidden if the connection node is collapsed. Collapse the connection node, search for a database, and click the match. Search closes and selects the database, but its row is still hidden under the collapsed connection node, so scrolling to it has no effect. Database activation
  • [P3] Database pagination restarts after the component unmounts. Close the workspace while a search-triggered page request is pending. Unmount aborts the request, but once it settles the loop issues another request with the same cursor. Stop the pagination loop when the component unmounts. Pagination loop · Unmount handler

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.

2 participants