Skip to content

Serialize metadata cursor queries via ExplorerSchemaService and use in Tree mixin#12

Merged
koianaoki merged 2 commits into
codex/fix-filter-issue-in-tree-viewfrom
codex/fix-show-columns-command-error
May 11, 2026
Merged

Serialize metadata cursor queries via ExplorerSchemaService and use in Tree mixin#12
koianaoki merged 2 commits into
codex/fix-filter-issue-in-tree-viewfrom
codex/fix-show-columns-command-error

Conversation

@koianaoki
Copy link
Copy Markdown
Owner

Motivation

  • Ensure raw cursor-returning metadata queries (e.g. MySQL SHOW statements) are executed through the session's serialized executor so they participate in the same retry/reconnect logic as other schema operations.
  • Avoid direct, unsynchronized access to the raw connection from UI code and keep error/retry behavior consistent for explorer metadata operations.

Description

  • Add ExplorerSchemaService.execute_cursor_query(query, database) which runs a cursor query through the service's serialized executor, returns (columns, rows), and always closes the cursor.
  • Update TreeMixin._fetch_cursor_result signature to accept an optional database and prefer calling schema_service.execute_cursor_query(...) when available, falling back to the direct connection otherwise.
  • Pass the selected node's data.database when invoking _fetch_cursor_result for MySQL SHOW FULL COLUMNS and SHOW INDEX code paths.
  • Update tests to reflect serialized execution: modify tests/ui/explorer/test_table_metadata_shortcuts.py to assert calls to execute_cursor_query and add tests/unit/test_explorer_schema_service.py to verify executor usage and cursor closure.

Testing

  • Updated UI tests in tests/ui/explorer/test_table_metadata_shortcuts.py were run and assert that execute_cursor_query is invoked for MySQL SHOW queries and that error paths notify appropriately, and they passed.
  • New unit test tests/unit/test_explorer_schema_service.py was run and verifies that execute_cursor_query schedules work on the session executor and closes the cursor, and it passed.

Codex Task

@koianaoki koianaoki merged commit e75a70e into codex/fix-filter-issue-in-tree-view May 11, 2026
@koianaoki koianaoki deleted the codex/fix-show-columns-command-error branch May 11, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant