Search code examples
postgresqlrubymine

How to export query results directly to a local CSV file from RubyMine


I am using RubyMine 6.3.3 Database Console window to run queries and export them to CSV

This involves 3 steps

Step 1. Run the query, wait quite some time to get results in a Visual way

Run the query to get results in a Visual way

Step 2. Click on the "File Icon" and select "Save All To File"

Click on the "File Icon" and select "Save All To File

Step 3: Wait again the same time of the step 1 to export it to CSV

enter image description here

I have checked RubyMine forums, the settings, whithout any success.

I also found this question on how to save (postgres) sql output to csv file

The answer to that question mentions this command

Copy (Select * From foo) To '/tmp/test.csv' With CSV;

but by using that approach the file is save on the server which I dont have direct access to.

Is there a way to run the query and get the results directly into a local CSV file, without getting the visual results


Solution

  • This feature is not yet implemented and is already and feature that has been requested to JetBrains and is reported in this links

    http://youtrack.jetbrains.com/issue/DBE-454

    http://track.jetbrains.com/issue/DBE-442#tab=Linked Issues

    So people interested in tracking this and update this answer please do.