Corrupt SQLite Databases

Nightmare. Once they get over ~2GB and you transfer them over the wire, they always seem to become corrupt. Here’s a fix

sqlite3 ../../Data/Crime/DBNAME.db
sqlite> .mode insert
sqlite> .output DBNAME_export.sql
sqlite> .dump
sqlite> .exit

mv DBNAME.db DBNAME.db.original

sqlite3 DBNAME.db < DBNAME_export.sql