jakob / jakob/Postico

JSON mode for sql query pane

Open
#459 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
485
Forks
8
PR merge metrics
No merged PRs in 30d

Description

I often have to construct fairly large JSON objects in postgres.

This usually happens if I have to pipe some data into a template or returning some data from an API. Postgres JSON support has become good enough, that it is preferable to assemble (and serialise) the whole object in PG, over getting the data from the db and constructing the object "by hand" one layer up.

It would be great to have a mode where the result is automatically pretty printed and syntax highlighted. These queries only have one row and one column.

Maybe you could switch automatically to a JSON view if only one row with one column is returned and this column contains json data.

I don't know if any other special mode would make sense - maybe XML, but who uses that anymore ; )

Anyway, right now the turnaround time for editing a query like this is quite high, since I have to copy the result into an editor and pretty print it there. But I think this style of query will only become more commonplace and having good support for this would make a great feature

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Postico’s SQL query pane and the result-rendering path. Review how one-row, one-column PostgreSQL results are displayed; done means JSON results can be automatically pretty-printed and syntax-highlighted, with the switching behavior defined for the proposed JSON mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.