I would like to compare 2 SQLite databases in order to check whether it needs to be updated on the client computer.
I am not really sure how I should do this. Whether I should make an internal version ID or compare the file size (which probally is not a good idea because I think the file size doesn't change anytime I edit the database).
Does anybody know a good way to do what I need to do?
Thank you!
You might try dumping each SQLite database, using SQLite's .dump
command:
$ sqlite3 /path/to/database1 .dump > database1.sql
$ sqlite3 /path/to/database2 .dump > database2.sql
And then comparing the generated files. If your two databases are quite similar, a simple diff
might work to show any differences, e.g.:
$ diff -u database1.sql database2.sql
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With