Add transposed (columns-as-rows) view for query results - #302
Open
jafigueroam94 wants to merge 1 commit into
Open
Add transposed (columns-as-rows) view for query results#302jafigueroam94 wants to merge 1 commit into
jafigueroam94 wants to merge 1 commit into
Conversation
Toggle the results grid with T to swap axes - column names down the left, each row as its own column - useful for wide result sets with many columns and few rows. Works per-section in stacked (multi- statement) mode. Actions that assume row=DB row/column=DB column (edit, delete, FK navigation, filter, and the cell/row "copy as..." menu) are disabled while transposed to avoid generating wrong SQL or mislabeled output.
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
Twhile the results table is focused to toggle a transposed view of the grid: column names run down the left side, and each original row becomes its own column - useful for wide result sets with many columns and few rows.edit_cell,delete_row, FK/referrers navigation, results filter, and the cell/row "Copy as..." menu) are disabled while transposed, since the cursor's row/column indices no longer map to the original data and would otherwise generate wrong SQL or mislabeled/incorrect copied output.No existing feature or open/closed issue/PR covered this - confirmed via a search of the repo's issues, PRs, and source before implementing.
Test plan
uv run pytest tests/unit/test_results_transpose.py- pure transpose helper + action-level guards/behavior (fake-app harness, no Textual)uv run pytest tests/ui/test_results_transpose.py- end-to-end pilot tests against a real running app: toggle on/off restores the grid exactly, stacked-mode per-section toggling, focus preservation across repeated toggles,View fulluses the transposed column label, new query results reset transpose state, no-results is a no-opuv run pytest tests/ui/keybindings/test_state_machine.py- guard/footer-binding coverage fortoggle_transposeand the actions blocked while transposeduv run pytest tests/- 1855 passed, 652 skipped, only 2 pre-existing failures unrelated to this change (test_detect_strategy_pip_user_fallback,test_postgresql.py::TestPostgreSQLIntegration::test_docker_container_connection- both require infra not available in this environment)