How to let csvkit/csvsql generate insert statements for csv file?
<p>I want to generate sql insert statements for some csv file. </p>

<p>I can do this using a one-liner awk script such as:</p>

<pre><code>awk -F "\t" '{printf("INSERT INTO T_COMMON_ENUM_VALUE (id,name,category_id) values (%s, '\''%s'\'', %s, %s);\n", $1, $2, $3, $4)}'
</code></pre>

<p>But this still requires some effort. csvsql inside csvkit seems to generate insert statements automatically. I checked the <a href="https://csvkit.readthedocs.org/en/0.9.1/scripts/csvsql.html" rel="noreferrer">documentation</a> and used the following command but it doesn't generate insert statements. </p>

<pre><code>$ cat data02.csv
db_enumvalue_id db_enumvalue_name       db_enumcategory_id
800     şirin   9

$ csvsql data02.csv
CREATE TABLE data02 (
        db_enumvalue_id INTEGER NOT NULL,
        db_enumvalue_name VARCHAR(18) NOT NULL,
        db_enumcategory_id INTEGER NOT NULL
);
</code></pre>

<p>It generates the create table statements. But the documentation says:</p>

<pre><code>Generate SQL statements for a CSV file or execute those statements directly on a database.
</code></pre>

<p>What should I do to get the insert sql statements using csvkit?</p>