Project

sql_csv

0.0
The project is in a healthy, maintained state
Use ActiveRecord to execute SQL against any DB to export CSV
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.3.2

Runtime

~> 0.5.3
 Project Readme

SqlCsv

Create a CSV export from a SQL query.

Installation

Add this line to your application's Gemfile:

gem 'sql_csv'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install sql_csv

Usage

An executable sql2csv is installed with the gem.

Write an SQL command to stdin and set DATABASE_URL to configure connection. CSV output will be written to stdout.

echo "select * from users" | DATABASE_URL='postgresql://user:password@host:1234/database' sql2csv > users.csv

License

The gem is available as open source under the terms of the MIT License.