Take the 2-minute tour ×

I would like to compare Sqlite databases with each other, both schema and data. I know that a rather crude method exists by comparing the database dumps with each other. But are ther any other methods as well? Especially from a command line environment. I know several tools for comparing databases exist, and I would like to know what sort of methodology they use.

share|improve this question
You want want to ask this over at DBA.SE instead. Maybe they have some interesting suggestions as well. –  haylem Jul 7 '12 at 18:26
add comment

2 Answers

If you only need rough precision, the dump method is crude but does get the job done.

If you want a lot of precision, I have done a similar task using Python's SQLite module. (http://docs.python.org/library/sqlite3.html) I grabbed and directly compared alike rows in each table and wrote out changes to a file, with further post-comparison and UPDATEs done after all comparison was done. You can do similar comparisons with the schema for each "*.db" file.

share|improve this answer
add comment

RedGate offers a suite of tools to help with DB comparisons: http://www.red-gate.com/products/sql-development/sql-compare/

There is a tool to compare schemas from different DB's as well as a tool to compare the data from tables or from the result of a query. We use the data compare tool every time we update our database to ensure that queries often done by our product code return the same data in the same order, etc.

share|improve this answer
I already know that tool, but I can't use it. I'm in a command line environment and cannot rely on existing tools and packages. What I'd really like to know is that methodology or technique it may possibly use in comparing dbs. –  Apophenia Overload Jul 6 '12 at 20:13
add comment

Your Answer


