yy0931 / sqlite3-editor

https://marketplace.visualstudio.com/items?itemName=yy0931.vscode-sqlite3-editor
GNU General Public License v3.0
682 stars 5 forks source link

Support for JSON field types #44

Closed itviewer closed 6 months ago

itviewer commented 6 months ago

Currently JSON fields are binary and cannot be edited

yy0931 commented 6 months ago

I'm sorry, but I'm not quite sure what your issue is. Are you referring to JSONB? If so, as mentioned below the input, it is currently read-only, but editing support will be implemented after its official release. If you are talking about regular JSON, although SQLite does not have a specific JSON data type, you should be able to edit JSON data by clicking on the "TEXT" button.

itviewer commented 6 months ago

Thank you for your reply. I encountered a very strange thing. I don’t know if it is a problem with my environment or a problem with sqlite3-editor. I have uploaded my sqlite test file as attachment. When I open it with sqlite3-editor, some of the columns in the first row are displayed as hexadecimal, but the exact same content in the second row can be displayed as text. The following screenshots are opened using sqlite3-editor ksnip_20240106-01 The following screenshots are opened using Navicat, and there is no problem ksnip_20240106-02

the sqlite file

anylink.zip

yy0931 commented 6 months ago

It seems the data in the first row is saved as BLOB. Was the record inserted by another application? If this is a common issue, I can consider adding a feature to treat BLOB data that is parsable as UTF-8 as TEXT.

image

itviewer commented 6 months ago

Yes, the first line is inserted by another application (Navicat opens without problems) and the second line is the first line that I copied manually in Navicat

itviewer commented 6 months ago

Should it be understood this way? If the application directly stores the byte array of json content, it is actually blob. If the application stores the string representation of json content, it is actually text. There is no real meaning of the JSON type?

yy0931 commented 6 months ago

Yes, see this section: https://www.sqlite.org/json1.html#interface_overview

itviewer commented 6 months ago

Thanks, now I know this should be handled by another application!