I am looking to import an CSV using Command Line Shell For SQLite on linux (SQLite version 3.29.0), and set the appropriate data types.
sqlite> .open outputSQLDB.db
sqlite> .import input.csv tmpTable
But now the imported table is messed up:
sqlite> .schema
CREATE TABLE DX(
"id,field1,field2" TEXT
);
Why aren't the fields separated?
At the end do I just do:
sqlite> CREATE TABLE myTbl (
...> id INTEGER,
...> field1 TEXT,
...> field2 INTEGER
...> );
CREATE INDEX id_index on myTbl (id);
sqlite> DROP TABLE IF EXISTS tmpTable;