I was simply instructed to automate the task of reporting at work. Someone used to run large, arbitrary SELECT
in a MySQL database using a GUI tool, and then used the same tool to export the results to CSV. Now I want to write a Ruby script to do this.
I know about FasterCSV in Ruby, but for SQL queries, I used only ActiveRecord, where you don't write queries at all, but use models and associations. The last time I wrote the full SQL code in the code, I encoded PHP.
What is the easiest way to do such things in Ruby? Should I use ActiveRecord?
source
share