tags:

views:

229

answers:

1

Using Linux, I want to compare two SQLite databases that have the same schema. There will be just a few differences.

Is there a tool that would output these differences? Preferably output them to the command line, so that I can grep/sed them.

SQLite uses SQL, so a general SQL tool might also do.

+5  A: 

One possibility is to use the sqlite3 command line client to export both databases and then diff the output. For example,

echo .dump | sqlite3 first.sqlite >first.dump
echo .dump | sqlite3 second.sqlite >second.dump
diff first.dump second.dump
laalto
It is sometimes difficult to guess what table the difference is in, but I will do without at first. An awk script might be able to show the table each diff comes from.
Nicolas Raoul