feat(databases): drain cursor for paginated databases list - #239
Merged
Conversation
GET /v1/databases is now paginated (one capped page + next_cursor); the SDK's databases().list gained limit/cursor in hotdata 0.10.0. Bump the dep and follow the cursor to the end so 'databases list', name/ catalog resolution, and the whole-workspace indexes-list id scan still see every database.
anoop-narang
requested review from
shefeek-jinnah
and removed request for
a team
July 23, 2026 12:35
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Show one capped page + a 'use --cursor <next>' hint (matching tables/queries list) instead of draining the whole workspace into memory. Name/catalog resolution and the whole-workspace indexes-list scan still drain every page internally (list_all_databases).
Contributor
There was a problem hiding this comment.
Reviewed the cursor-drain helper, the user-paginated databases list, and the main.rs wiring. Logic is correct (non-advancing-cursor guard is sound) and the display command matches the existing tables list pagination UX. No new issues; the two prior nits stand as already noted.
Address review nits on #239: - add list_all_databases_follows_cursor: two mocked pages exercise the cursor-following drain (the prior mocks were single-page) and the non-advancing-cursor guard. - drop the unnecessary next_cursor clone in list_all_databases by moving the page rows out first (partial move).
Contributor
Author
|
Both addressed: added |
Same next_cursor.clone() avoidance as list_all_databases: read the cursor before moving the page rows out (partial move).
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.
What & why
GET /v1/databasesis now paginated (runtimedb #960): one capped page + anext_cursor. The SDK'sdatabases().list()gainedlimit/cursorinhotdata0.10.0. This bumps the dep to 0.10.0 and adapts the CLI:databases listis now user-paginated —--limit/--cursor, showing one page plus aMore results available. Use --cursor <next>hint, matching the existingtables list/queries listUX (rather than dumping the whole workspace).try_resolve_database) and the whole-workspaceindexes listscan (list_database_ids, indexes list (unscoped) misses managed-database indexes #168) still need the complete set, so they drain all pages internally via a sharedlist_all_databaseshelper (followsnext_cursorto the end, with a non-advancing-cursor guard).The first page keeps the cold-start "waking up worker" spinner; results are shown in the server's newest-first order for coherent cursor continuation.
Depends on
hotdata0.10.0 (published to crates.io). Full CLI test suite passes.