How to download CSV without rerunning query

Every time I download a .CSV in Data Grip, the query has to re-run.  Is there anyway to prevent this from happening?  I've never used a SQL client that had to rerun each query in order to download.

7 comments
Comment actions Permalink

Hello Andrew,

Can you please describe how do you import the results?

Note that Results tab in the Database Tool Window could be showing only a portion of select (if query results are too big), but when you are exporting the results in a file DataGrip will select all the remaining rows. The portion of the result which is being selected is configured in prefetched size option in File | Settings | Database | Data Views settings.

Does it help?

0
Comment actions Permalink

I have this problem too. 

If I have a query that takes some time to construct and run, yes it does only show the first ~500 rows or so. 

Then if I click export to csv, it re runs the query (taking the time) and then exports it to file. 

When the queries use variables set prior to the main query, it is particularly annoying, as the variables may no longer be set by the time I re run the query. 

Generally I find the interface is hard to use and understand the status (executing or not) if you are running long running queries, across different databases. 

0
Comment actions Permalink

If you select your query and right-click, you can choose Execute to File

8
Comment actions Permalink

Has anyone found a solution to this? I used to be able to export results easily, but long queries are now re-running upon selecting export results. 

0
Comment actions Permalink

+1 have the same issue. How do you download results to file without re-running the query?

0
Comment actions Permalink

Yeah I also have this problem. It makes no sense even the most basic SQL client won't make you double your wait time for a query. I don't want to have to execute every query to a file for this.

0
Comment actions Permalink

I agree - there should be a possibility to set DataGrip to always download the whole results for given data source or for queries run from given file/console, so than when user would like to save results he wouldn't have to rerun query again.

0

Please sign in to leave a comment.