Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON viewer for working with JSON/JSONB columns #395

Open
cymen opened this issue Jun 20, 2017 · 24 comments
Open

JSON viewer for working with JSON/JSONB columns #395

cymen opened this issue Jun 20, 2017 · 24 comments

Comments

@cymen
Copy link

cymen commented Jun 20, 2017

It would be great to have a nicer viewer for the JSON/JSONB columns/cells. Maybe on mouse hover one could see nicely formatted JSON to make it easier to look through instead of a compacted string.

@ivosabev
Copy link

+1

@excenter
Copy link

excenter commented Dec 7, 2017

and editing.

@Aymericr
Copy link

+1

2 similar comments
@pholbrook
Copy link

+1

@andreieuganox
Copy link

+1

@dynajoe
Copy link

dynajoe commented Jun 7, 2018

One of the best features of Postgres is the native JSON support. I use it all the time.

@okev
Copy link

okev commented Aug 2, 2018

+1

@qwesda
Copy link

qwesda commented Sep 6, 2018

For me the most important part would be to have a JSON viewer in the query result window. I frequently write long queries that produce JSON that will then be directly passed to templating engines. This quickly gets unwieldy and I'm currently resorting to copy-pasting the code to my text editor end reformatting the JSON there to see whats going on. Having a special result viewer for queries that return one single row/column that only contains one big JSON object would be great.

Bonus points for the JSON viewer remembering the previously opened/closed nodes. If the default view is all nodes open, the viewer should remember the paths of the user-closed-nodes and resorts that state (vice versa if nodes are default open).

@iguana
Copy link

iguana commented Jul 24, 2019

We also use a lot of JSON/JSONB and editing it in Postico is a nearly impossible.

@andreieuganox
Copy link

+1

@boris-glumpler
Copy link

Editing currently involves copying the JSON field, pasting it into an editor, hitting format, changing the value, then pasting it back into Postico. Viewing a JSON field just involves the first 3 steps. It works, but is pretty annoying. Anything to make this process less painful would be much appreciated.

@squallstar
Copy link

squallstar commented Mar 16, 2020

We have a lot of JSONB data in our DB so a lightweight editor with syntax highlighting would be highly appreciated.

A solution would also be to have Postico somehow open the JSON in an external editor (e.g. VSCode), then listen for save events on the temporary file so that once it's saved via Cmd+S in VSCode it reflects in the pending changes in Postico.

Thoughts?

@iguana
Copy link

iguana commented Mar 16, 2020

The 2.0 beta version has a JSON editor in the side panel, that's what we've been using. If you like VSCode, check out Azure Data Studio.

@squallstar
Copy link

@iguana the same editor is in the current stable version (1.5) but it's far from ideal:

  1. no syntax highlighting
  2. hard to make lots of changes as it's small unless you keep expanding and shrinking the side panel
  3. no autocompletion for double quotes and curly/square brackets

Also, I'm not sure in what context you are recommending Azure Data Studio as it surely doesn't support PostgreSQL. I mentioned VSCode as a text editor, any other like Atom, Sublime, CotEditor would have worked too if we can implement external editing of the JSON.

@ChuckJonas
Copy link

Formatting and syntax highlighting would be nice, but right now I would be happy just to have the ability to expand the cell or even just use the down arrow key to navigate text wrapping.

I love postico, but the experience of working with JSON columns is horrible

@squallstar
Copy link

I've actually switched away from Postico to DataGrip because the latter offers a way better experience when viewing and making changes to JSON data.

@henryeagar
Copy link

viewing JSON would be super, but I'd also like to use "JSON Functions and Operators" in Filters.

@jakob
Copy link
Owner

jakob commented Aug 24, 2021

Short update: In Postico 2 you can now double click JSON and JSONB fields to show the data in a popover. JSONB is also pretty-printed automatically.

It's not a full fledged JSON editor (just a text editor) but I think it's a nice improvement nevertheless!

@qwesda
Copy link

qwesda commented Aug 24, 2021

I agree that it is already an improvement, thx!

Maybe using a monospace font for the JSON editor would improve readability.

@qwesda
Copy link

qwesda commented Aug 27, 2021

I just noticed the following, not sure if this is the intended behaviour:

The JSON editor is not opened if a JSON cell contains NULL.

@cymen
Copy link
Author

cymen commented Aug 27, 2021

If you're like me and wondering where to get Postico 2, search your email for Postico 2 and you should have an email from Jakob that is titled Feedback wanted: Postico 2 Preview (I missed it). At least if you licensed a prior version.

@cymen
Copy link
Author

cymen commented Aug 27, 2021

@jakob Is pretty printing for JSON coming too? I happen to be working on a project at the moment that for whatever reason has a lot of JSON columns (not sure why, I suspect when the schema was created, there might have been a lack of understanding of what JSONB is). It would be great to have pretty-printed JSON.

@jakob
Copy link
Owner

jakob commented Aug 30, 2021

@cymen Regarding Postico 2 preview, there's also an issue pinned to the top of the list here on Github issues: #689. Or you can go directly to https://eggerapps.at/postico2/

Regarding JSON vs. JSONB: We didn't want to enable pretty-printing for JSON since whitespace changes are significant for JSON. We assumed that most people use JSONB anyway.

However, I also assume that the people who use JSON probably do so for historic reasons (it was introduced before JSONB), and that they don't really care about whitespace significance. So it may be worthwhile to treat JSON the same as JSONB in Postico.

@yinzara
Copy link

yinzara commented Oct 24, 2024

This feature would be super helpful with .NET Entity Framework projects after:
npgsql/efcore.pg#3285

Is merged. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests