Repository navigation
Show JSONB blobs as JSON in the Edit Cell dock - #4227
Open
deepsidhu1313 wants to merge 4 commits into
Open
deepsidhu1313 wants to merge 4 commits into
deepsidhu1313 wants to merge 4 commits into
Conversation
Blobs that are SQLite JSONB arrays or objects (SQLite 3.45 and newer) are now shown as read-only JSON text when the Edit Cell dock is in one of the text or JSON modes, instead of the "Binary data can't be viewed in this mode" message. The data type stays Binary, so editing, applying and exporting work as before, and the info label reads "Binary (JSONB)". The conversion is done by SQLite itself (json() on a :memory: handle). Only containers whose header size matches the blob length are detected, because most other short blobs are valid JSONB as well. Add a test-jsonb target for the detection and conversion. Closes sqlitebrowser#3578 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a test-edit-dialog target that loads JSONB, binary and text data into the dialog without a display and checks that JSONB is shown as read-only JSON, that the editor is writable again for the next text value, and that other binary data still shows the usual message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test-global-filter needs the CMake prefix paths on PATH on Windows because the CI jobs build SQLite as a DLL there. test-jsonb and test-edit-dialog link SQLite too and crashed on Windows without them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The .ui files connect to slots that don't exist in Qt6 (QDialog::help) unless uic generates string based connections. The main target already sets this option for Qt6, but test-edit-dialog compiles the dialogs' .ui files as well and failed to build in the Windows on ARM job. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Blobs that are SQLite JSONB arrays or objects (SQLite 3.45 and newer) are now shown as read-only JSON text when the Edit Cell dock is in one of the text or JSON modes, instead of the "Binary data can't be viewed in this mode" message. The data type stays Binary, so editing, applying and exporting work as before, and the info label reads "Binary (JSONB)".
The conversion is done by SQLite itself (json() on a :memory: handle). Only containers whose header size matches the blob length are detected, because most other short blobs are valid JSONB as well.
Add a test-jsonb target for the detection and conversion.
Closes #3578