pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.46k stars 643 forks source link

Add JSON format support for "Export data" operation #6680

Open 62mkv opened 1 year ago

62mkv commented 1 year ago

Describe the solution you'd like

In the "Import/Export data" operation for a table, there're 3 formats available: binary, csv, and text. (I am using v.6.17 but searching thru issues I could not find anything relevant either, so please close a Duplicate if already implemented in later version)

I would like to have "json" option available too

Describe alternatives you've considered

I guess, there're tools out there converting csv to JSON; should not be too difficult

Additional context

I'm used to export data as JSON in some SQL clients, like dBeaver or IntelliJ DataGrip; unfortunately, for some DBs I can not use those and can only use pgAdmin; so it would be great to have this feature here as well

62mkv commented 1 year ago

btw, on alternatives: https://github.com/jqlang/jq/wiki/Cookbook#convert-a-csv-file-with-headers-to-json

62mkv commented 1 year ago

by the way, I could not find a way to download the exported data file from the WebUI... is there one? Looks like I have to have access to FS on the server to access those files

nikhil-mohite commented 1 year ago

Currently, PostgreSQL doesn’t support this, pgAdmin needs to implement on its own

dpage commented 1 year ago

Import/Export Data is essentially a wrapper around the psql \copy command. Therefore JSON support would have to be added there first.