feat(indexes): workspace-wide list with filters and parallel fetch#61
Conversation
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.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| if !body.has_more { | ||
| break; | ||
| } | ||
| cursor = body.next_cursor; |
There was a problem hiding this comment.
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.
| 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)
| let body: ConnectionsBody = api.get("/connections"); | ||
| let mut m = HashMap::new(); | ||
| for c in body.connections { | ||
| m.insert(c.id.clone(), c.id.clone()); |
There was a problem hiding this comment.
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.
| m.insert(c.id.clone(), c.id.clone()); | |
| m.insert(c.name.clone(), c.id); |
(not blocking)
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.