tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.58k stars 79 forks source link

Refactor export; make adapter-agnostic #413

Closed matsonj closed 7 months ago

matsonj commented 8 months ago

Describe the bug When connected to a database (in my case, SQL Server) with the odbc driver, you cannot export data with ctrl+e, even though the data is clearly exposed in the interface.

To Reproduce

  1. connect to harlequin with odbc connector
  2. run any query
  3. press "ctrl+e" to export the data
  4. you will get an error

Expected behavior data exports as csv.

Actual behavior you get this error. image

Additional context

What database adapter are you using with Harlequin? ODBC

Can you tell us more about your system?

matsonj commented 8 months ago

I recognize this is actually a feature request, sorry in advance @tconbeer

tconbeer commented 8 months ago

Yeah this is expected for now. I actually think I'm going to change the whole export thing to just export the data in the table, since we already have that locally in Arrow. Would that work for you or do you expect something closer to a COPY TO statement?

matsonj commented 8 months ago

Yeah I don't think 'copy to' is the right path. Since the data is already in arrow locally, it's makes more sense to me to use those libraries to export to csv etc.

tconbeer commented 8 months ago

Yeah, ok that's good validation. In the meantime, ctrl+a and ctrl+c will work for datasets that aren't too huge.