concretesubmarine.com/ FORUM

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: Big CSV exports with Rails


Senior Member

Status: Offline
Posts: 116
Date:
Big CSV exports with Rails
Permalink   
 


One of the projects we are currently working on required strict reporting: sales and transaction data for years - all this had to be exported as CSV files. Large CSV files.

Normally I could queue the export and execute it as a background process, but this time I found a quick win: using a combination of find_each ActiveRecord and Ruby Enumerator to stream CSV - in batches and directly from the controller.
What do you think about it?



__________________


Newbie

Status: Offline
Posts: 3
Date:
Permalink   
 

It sounds good. Details?

__________________


Veteran Member

Status: Offline
Posts: 50
Date:
Permalink   
 

Wow, thanks for sharing such a tip. I usually use Coupler.io when exporting ad data to Google docs. You can find more info there if you become interested in doing it in such an easy way now. I even wonder if it was done manually back in the day. I guess if I wasn't supervised at work and helped out, that's what I would do. I don't think it would have been effective. I would quickly get bored of doing it, especially if something needs to be sent in urgently for inspection. Is there anyone like me?



-- Edited by mylesduffy on Monday 9th of May 2022 01:43:51 PM

__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard