Skip to content

feat(indexes): workspace-wide list with filters and parallel fetch#61

Merged
eddietejeda merged 1 commit into
mainfrom
feat/indexes-list-workspace
Apr 27, 2026
Merged

feat(indexes): workspace-wide list with filters and parallel fetch#61
eddietejeda merged 1 commit into
mainfrom
feat/indexes-list-workspace

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Indexes list no longer requires connection, schema, and table. Defaults to all tables in the workspace; optional flags narrow the catalog scan.

Resolve information_schema connection labels to connection IDs via GET /connections. Skip missing tables when the indexes endpoint returns 404 so stale catalog rows do not abort the run.

Fetch per-table indexes in parallel with rayon to reduce wall-clock latency. Add ApiClient::Clone and get_none_if_not_found for the scan.

Indexes list no longer requires connection, schema, and table. Defaults
to all tables in the workspace; optional flags narrow the catalog scan.

Resolve information_schema connection labels to connection IDs via
GET /connections. Skip missing tables when the indexes endpoint
returns 404 so stale catalog rows do not abort the run.

Fetch per-table indexes in parallel with rayon to reduce wall-clock
latency. Add ApiClient::Clone and get_none_if_not_found for the scan.
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 0% with 163 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/indexes.rs 0.00% 136 Missing ⚠️
src/api.rs 0.00% 21 Missing ⚠️
src/main.rs 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/indexes.rs
Comment on lines +89 to +92
if !body.has_more {
break;
}
cursor = body.next_cursor;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: If the server ever returns has_more: true with next_cursor: null (e.g., a transient API bug), the loop spins forever — each iteration re-sends the same cursor-less request.

Suggested change
if !body.has_more {
break;
}
cursor = body.next_cursor;
if !body.has_more || body.next_cursor.is_none() {
break;
}
cursor = body.next_cursor;

(not blocking)

Comment thread src/indexes.rs
let body: ConnectionsBody = api.get("/connections");
let mut m = HashMap::new();
for c in body.connections {
m.insert(c.id.clone(), c.id.clone());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

super nit: The id → id entry is redundant — when t.connection is already a valid ID, the .unwrap_or(t.connection.as_str()) fallback in the caller produces the same result. Dropping this insert also eliminates the (admittedly unlikely) collision where a connection's name equals a different connection's ID, which would cause the second insert to overwrite the first and mis-resolve lookups.

Suggested change
m.insert(c.id.clone(), c.id.clone());
m.insert(c.name.clone(), c.id);

(not blocking)

@eddietejeda eddietejeda merged commit d6ca336 into main Apr 27, 2026
8 of 9 checks passed
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.

1 participant