NAME

krang_generate_csv - create a CSV file from Krang data


SYNOPSIS

Run this SQL statement for the ``foo'' instance and print a CSV file to STDOUT

  $ krang_generate_csv -i foo -q 'SELECT story_id, title FROM story'

With a header line

  $ krang_generate_csv -i foo -q 'SELECT story_id, title FROM story' -c 'ID,Title'


DESCRIPTION

It's common to want custom CSV reports from Krang data. This makes it really easy once you have the SQL.

OPTIONS

-i or --instance

The instance that the SQL is running against. This is optional and if not specified will fallback to using the KRANG_INSTANCE environment variable.

-q or --sql

The SQL being executed.

-c or --header

A comma separated list of words that will be used as the header row for the CSV file. By default there is no header row.

-h or --help

-m or --man