Repository navigation
Database picker: search on the server instead of listing every database - #68
Merged
Merged
Conversation
Listing every database took ~935ms on a 1,594-database workspace and grows with workspace size. The picker now loads options per keystroke from GET /v1/databases?search= (one page of 50, ~70ms), and resolves a saved database id to its name via ?id=.
eddietejeda
requested review from
rohan-hotdata
and removed request for
a team
October 24, 2026 22:55
| useEffect(() => { | ||
| const id = query.databaseId; | ||
| if (!id) { | ||
| return; |
There was a problem hiding this comment.
nit: Skip the id lookup when selected?.value === id (not blocking).
Selecting an option calls setSelected(v) and then onChange. The onChange changes query.databaseId, so this effect fires GET databases?id= for a database whose name is already known. Each pick costs one redundant backend and Hotdata API round trip. A custom value from createCustomValue also triggers a lookup that always fails with 502.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #66. Loading every database (all pages) was slow in large workspaces and grows with workspace size.
databasesresource takes?search=(passed toGET /v1/databases?search=, one page of 50) and?id=(resolves one database viaGET /v1/databases/{id}). ReplacesListDatabaseswithSearchDatabases.search.Live timing (large workspace, through Grafana)
demoTesting
go test ./pkg/...: search, no-match returns[], lookup by id.npm run typecheck,npm run lint.