SQL2CSV(1) csvkit SQL2CSV(1) (NAME) sql2csv - SQL CSV (DESCRIPTION) SQL CSV: usage: sql2csv [-h] [-v] [-l] [-V] [--db CONNECTION_STRING] [--query QUERY] [-e ENCODING] [-H] [FILE] SQL CSV. : FILE SQL . FILE --query () STDIN . : -h, --help --db CONNECTION_STRING SQLAlchemy . --engine-option ENGINE_OPTION ENGINE_OPTION ()create_engine SQLAlchemy . . : thick_mode True --execution-option EXECUTION_OPTION EXECUTION_OPTION ()execution_options SQLAlchemy . . : stream_results True --query QUERY SQL . FILE STDIN . -e ENCODING, --encoding ENCODING . -H, --no-header-row ( ). (EXAMPLES) csvsql sql2csv: csvsql --db "sqlite:///dummy.db" --tables "test" --insert examples/dummy.csv sql2csv --db "sqlite:///dummy.db" --query "select * from test" PostgreSQL. : createdb recipients csvsql --db "postgresql:///recipients" --tables "fy09" --insert examples/realdata/FY09_EDU_Recipients_by_State.csv sql2csv --db "postgresql:///recipients" --query "select * from fy09 where \"State Name\" != '' order by fy09.\"TOTAL\" limit 3" SQL ( SQLite ): sql2csv --query "select 300 * 47 % 14 * 27 + 7000" . MySQL: sql2csv --db 'mysql://user:pass@host/database?charset=utf8' --query "SELECT myfield FROM mytable" (AUTHOR) Christopher Groskopf (COPYRIGHT) 2016, Christopher Groskopf and James McKinney 2.2.0 SQL2CSV(1)