Repository navigation
Sort Execute SQL results by header click and show small BLOBs as hex - #4241
Open
deepsidhu1313 wants to merge 2 commits into
Open
deepsidhu1313 wants to merge 2 commits into
deepsidhu1313 wants to merge 2 commits into
Conversation
Clicking the header of a result column in the Execute SQL tab only selected the column. Add an option to sort the results by it instead: the first click sorts ascending, the second descending and the third goes back to the original order. The option is off by default and can be changed in the SQL tab of the preferences (editor/sort_results), so nothing changes for anyone who doesn't turn it on. The results of a custom query can't be sorted by changing its ORDER BY clause, so the query is wrapped instead: SELECT * FROM (<query>) ORDER BY <column number>. Using the column number makes this work for columns which have the same name or no usable name. This is only done for SELECT and WITH statements which don't modify data. PRAGMA and EXPLAIN statements and statements which return the rows they changed using RETURNING keep their behaviour, they cannot be used as a subquery. Exporting the results and saving them as a view use what is shown, like they do for the table browser. The sort indicator in the header of custom query results is based on the column number, too. Before, columns with the same name all got the indicator. The sorting is part of SqliteTableModel and covered by the new test-result-sort.
BLOBs are shown as the BLOB text (BLOB, unless changed in the preferences) in the cells of the data browser and the Execute SQL results. Add the option to show BLOBs up to a given size as hexadecimal string instead, like the one the hex() function returns, so values like hashes or UUIDs can be read at a glance. The size is set in the Data Browser tab of the preferences (databrowser/ blob_hex_limit) in bytes. It is 0 by default, which turns the option off and keeps showing the BLOB text. BLOBs which are larger than the limit still show the BLOB text, and long hex strings are cut off at the symbol limit like text. Only the text shown in the cell changes. The data used for editing, exporting and copying as SQL is the same as before. Covered by the new test-blob-display.
deepsidhu1313
force-pushed
the
feature/exec-sql-ux
branch
from
November 1, 2026 02:41
de5f423 to
702479f
Compare
This branch has not been deployed
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.
Two commits, both behind settings that are off by default.
Closes #1177, closes #1201