[Feature Request] JSON viewer?

[expired user #8974]'s profile image [expired user #8974] posted 9 years ago in Feature discussion Permalink
Hi there.

Is there any intention of adding some kind of JSON viewer/editor for fields which stores JSON data? Or into the Text Editor when I edit those fields?

I mean JSON editor like this i.e.: http://www.jsoneditoronline.org/

In my case, I store some array dumps in error log in database and I can imagine this would be much more comfortable way of reading JSON then just plain text. :)

Thanks for the answer.

jaCUBE
ansgar's profile image ansgar posted 9 years ago Permalink
How should HeidiSQL detect that you have JSON stored in your text field?
[expired user #8974]'s profile image [expired user #8974] posted 9 years ago Permalink
Well, it came up on my mind and accoding to Stack Overflow, there might be some regex options for this: http://stackoverflow.com/questions/2583472/regex-to-validate-json

However, I doubt one more click would be some problem for anyone.smileI think maybe something like this in picture? http://i.imgur.com/sIwIFUC.png
Then it would be on my responsibility to click "View JSON" button.

Anyway, please, consider this just like an idea how to make HeidiSQL even more cooler than it is. ;)
[expired user #8974]'s profile image [expired user #8974] posted 9 years ago Permalink
Maybe better would be call it "Try to parse JSON". :)
ansgar's profile image ansgar posted 9 years ago Permalink
I don't think I can make a clickable tree fron Json content. But I can probably add syntax highlighting for various different languages, including json. And then provide a dropdown menu for selecting the language. That's not a big deal probably because I already have SynEdit for SQL highlighting.
[expired user #8974]'s profile image [expired user #8974] posted 9 years ago Permalink
Oh, never mind. Syntax highlighting for JSON/XML would be neat too. I think these are only major languages stored in database and HeidiSQL supporting them would remove some pain. :)

Thank you.
[expired user #5008]'s profile image [expired user #5008] posted 9 years ago Permalink
SynEdit now has a JSON formatter.

https://bitbucket.org/sas_team/synedit-git/commits/42763857ac2cfc58dfa60e55b5d75ace1531cdb7
[expired user #10265]'s profile image [expired user #10265] posted 6 years ago Permalink

Love how others are thinking the same.

In mySQL there is a DataType: JSON

The logic could be if DataType == 'JSON' OR DataType == 'LONGTEXT'

Then display a JSON viewer/formatter component.

This would make HeidiSQL an absolute God product.

ZuLuuuuuu's profile image ZuLuuuuuu posted 5 years ago Permalink

Being able to edit JSON fields (or text fields as JSON since old MySQL versions don't support native JSON type) would be much appreciated. It does not need to be expandable tree or something. Just an option to prettify the indents and syntax highlighting is enough.

DB Browser for SQLite is perfect in this regard, it gives you an option to automatically guess the text mode (text, JSON, XML) or let's you select the mode manually. It also gives you a toggle button to automatically prettify the JSON or not.

maykar1302's profile image maykar1302 posted 4 years ago Permalink

JSON support is a wonderful thing! It will definitely add value to the already excellent HS.

Pedroprt's profile image Pedroprt posted 3 years ago Permalink

Json viewer would be a great tool. I'm trying Heidi and it looks very good. Json viewer will be welcome

ansgar's profile image ansgar posted 3 years ago Permalink

I intended to extend the grid text editor with some code highlighters in the near future. See https://github.com/HeidiSQL/HeidiSQL/issues/136#issuecomment-365400828 - talking about XML there, but JSON is also just one of the SynEdit hightlighters.

Please login to leave a reply, or register at first.