Thanks for maintaining this plugin! It's become essential to my workflow.
The idea
A command (e.g. :DBUIExportCSV) that exports the current query's results as CSV.
Why
Query results in the buffer are great for inspection, but sharing or importing into other tools (spreadsheets, scripts) means manually reformatting. CSV is the most universal interchange format for tabular data.
Suggested approach
Rather than parsing the ASCII table output, the adapter layer could re-run the query using the database CLI's native CSV output mode:
- psql:
-P format=csv
- mysql:
--batch --raw (produces tab-separated; trivial to convert)
- sqlite3:
-csv -header
vim-dadbod's db#adapter#dispatch() already supports additional arguments, so CSV flags could be passed through without major plumbing changes.
Related
Happy to help with implementation if this is something you'd want in the plugin.
Thanks for maintaining this plugin! It's become essential to my workflow.
The idea
A command (e.g.
:DBUIExportCSV) that exports the current query's results as CSV.Why
Query results in the buffer are great for inspection, but sharing or importing into other tools (spreadsheets, scripts) means manually reformatting. CSV is the most universal interchange format for tabular data.
Suggested approach
Rather than parsing the ASCII table output, the adapter layer could re-run the query using the database CLI's native CSV output mode:
-P format=csv--batch --raw(produces tab-separated; trivial to convert)-csv -headervim-dadbod's
db#adapter#dispatch()already supports additional arguments, so CSV flags could be passed through without major plumbing changes.Related
Happy to help with implementation if this is something you'd want in the plugin.