Is there a command line utility for validating SQLite databases in Linux? [closed] Is there a command line utility for validating SQLite databases in Linux? [closed] sqlite sqlite

Is there a command line utility for validating SQLite databases in Linux? [closed]


You can do something like this:

sqlite3 database.db "PRAGMA integrity_check"


You can use PRAGMA integrity_check on the database.

If the Database is corrupted you can use this SQLite command:

cd $DATABASE_LOCATIONecho '.dump'|sqlite3 $DB_NAME|sqlite3 new_repaired_$DB_NAMEmv $DB_NAME corrupt_$DB_NAMEmv new_repaired_$DB_NAME $DB_NAME