GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Sort Execute SQL results by header click and show small BLOBs as hex by deepsidhu1313 · Pull Request #4241 · sqlitebrowser/sqlitebrowser

Conversation

@deepsidhu1313

@deepsidhu1313 deepsidhu1313 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Two commits, both behind settings that are off by default.

  1. Sort Execute SQL results by clicking a column header (editor/sort_results, Preferences > SQL). Clicking cycles ascending, descending, original order by wrapping the query as SELECT * FROM () ORDER BY . Only read-only SELECT/WITH statements are wrapped (prefix check plus sqlite3_stmt_readonly); PRAGMA, EXPLAIN and DML with RETURNING are left alone. Known limitation: the Plot dock is not refreshed after a sort. test-result-sort, 19 cases (10 failed before).
  2. Option to show small BLOBs as hex (databrowser/blob_hex_limit in bytes, 0 = off). Only the display role changes. test-blob-display, 10 cases (5 failed before).

Closes #1177, closes #1201

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
claude added 2 commits October 31, 2026 19:33
@claude
Sort Execute SQL results by clicking on a column header
830e22f
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.
@claude
Add an option to show small BLOBs as hex strings in the cells
702479f
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
deepsidhu1313 force-pushed the feature/exec-sql-ux branch from de5f423 to 702479f Compare November 1, 2026 02:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add option to show (small) BLOBs as hex strings Sorting query results by click on result column title

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@deepsidhu1313 @claude
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.