okbob / pspg

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.
BSD 2-Clause "Simplified" License
2.43k stars 85 forks source link

Feature idea: table editor? #200

Closed df7cb closed 2 years ago

df7cb commented 2 years ago

Hi Pavel,

something that I have wanted for a long time is the ability to easily edit some fields in a table from psql. Ideally from the last query result, so select * from tbl where id = 5;, and then being able to update some fields in there, without having to type a lengthy update tbl set foo = 'bar' where id = 5; statement.

From the user interface, I think it would fit into pspg. I have no idea how to actually know which table/query result is being displayed, let alone how to figure out which SQL to send back from the pager. It would probably at least need the query passed in an environment variable or some similar interface, and from there figure out what tables are involved, and how to update them. Plus maybe a connection string for the current database.

Do you think that would be feasible? What infrastructure would be needed from psql? Possibly that could be useful for other applications as well.

Feel free to just close this issue if you don't think it makes any sense. I'm just filing it here to start investigating it.

Thanks.

okbob commented 2 years ago

Hi

po 7. 3. 2022 v 11:44 odesílatel Christoph Berg @.***> napsal:

Hi Pavel,

something that I have wanted for a long time is the ability to easily edit some fields in a table from psql. Ideally from the last query result, so select

  • from tbl where id = 5;, and then being able to update some fields in there, without having to type a lengthy update tbl set foo = 'bar' where id = 5; statement.

From the user interface, I think it would fit into pspg. I have no idea how to actually know which table/query result is being displayed, let alone how to figure out which SQL to send back from the pager. It would probably at least need the query passed in an environment variable or some similar interface, and from there figure out what tables are involved, and how to update them. Plus maybe a connection string for the current database.

Do you think that would be feasible? What infrastructure would be needed from psql? Possibly that could be useful for other applications as well.

Feel free to just close this issue if you don't think it makes any sense. I'm just filing it here to start investigating it.

pspg is pager. In most cases there is not any information about source query. So something like this is not possible. Moreover, pspg does not connect to postgres.

So I have no idea how it can be possible to implement the proposed idea.

Regards

Pavel

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/okbob/pspg/issues/200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO44KFVM6WPHCL6DX6HDU6XMZ3ANCNFSM5QC4XQKQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

df7cb commented 2 years ago

Right, that's the current status. Maybe we can improve that in the future...

I'll close the issue, thanks. Possibly we can figure out how to do that eventually...