csvs-to-sqlite icon indicating copy to clipboard operation
csvs-to-sqlite copied to clipboard

Schema mis-matches in multi-CSV imports into existing databases needs more helpful errors

Open warriorstar-orion opened this issue 3 years ago • 0 comments

Hello,

Assume I have a sqlite3 database with a table foo, and a file named foo.csv which I'd like to import. The behavior is to add these data into the table with the existing filename, which is what I want. However, let's say foo.csv includes several more columns not in the foo table schema. To figure this out, I have to find out one column at a time: that is, run csvs-to-sqlite foo.csv db.sqlite, wait for it to spit out an error such as sqlite3.OperationalError: table foo has no column named bar, add that column to foo.csv, and try again, for each column missing in the schema.

A --dry-run option that lets one know of these schema mis-matches, all of them, ahead of time, would be incredibly helpful.

Thanks!

warriorstar-orion avatar Jan 27 '21 21:01 warriorstar-orion