I do this in backup testing:
sqlite3 /path/to/db
sqlite> PRAGMA integrity_check;
See SQLite3 documentation: https://www.sqlite.org/pragma.html#pragma_integrity_check