csvsql

Generate SQL statements for a CSV file or execute those statements directly on a database.

TLDR

Generate a CREATE TABLE SQL statement for a CSV file

>_ csvsql [path/to/data.csv]
copy

Import a CSV file into an SQL database

>_ csvsql --insert --db "[mysql://user:password@host/database]" [data.csv]
copy

Run an SQL query on a CSV file

>_ csvsql --query "[select * from 'data']" [data.csv]
copy

Copied to clipboard
free 100$ digital ocean credit