PHP SQLDiff is a web-based tool designed to display the discrepancies between two SQL databases. It allows users to easily compare and contrast the contents of two tables.
Unfortunately, getting what we want is not always an easy task. When dealing with any diff, the more changes there are, the harder it becomes to determine what occurred. SQLDiff provides scrolled sets of changed rows, but managing a million changes is beyond any reasonable capacity. It is crucial that the tables have a primary key, and SQLDiff allows you to specify the column to use as a comparator. However, if your tables do not have the same primary key, SQLDiff will not allow you to make any changes. In fact, if you choose the incorrect comparator column, or the data for the column is not unique, you could end up causing serious damage to your tables.
The two tables that are being compared must be fundamentally the same, with the same column names and matching column data types. SQLDiff can compare tables that do not have the same columns, but you must pick which columns to compare. Similarly, it pretends that columns with the same name but with different data types are the same. This is not always accurate, so be cautious when making alterations to tables that are unlike. As the tables become more different, the differences become more numerous, and it may be increasingly difficult to determine what changes occurred.
There are instances when you've simply added or deleted a column or two when making a change. In this case, SQLDiff will recognize this and allow you to pick which columns to compare. Nonetheless, it is still critical to have matching primary keys.
Diffing really large tables can take an exceptionally long time. Comparing tables necessitates reading the whole table, which could be taxing on your systems. SQLDiff works well with a few tens of thousands of rows, but if you have millions of rows, you will run out of memory or not receive any feedback on your web server configuration. Comparing very large tables is never a pleasant experience.
Once the diff is known, you can make changes so that specific rows or columns or all rows or columns can be updated in the master table from the modified table. However, before committing a database change, it is recommended to use the new 'Show SQL' button and assess whether the SQL is reasonable.
SQLDiff is not intended to be a protective tool for databases that are in flux. If you have two tables and perform a diff, and one of them changes shortly after, attempting to sync them with SQLDiff could lead to unpleasant surprises.
Version 2.2: N/A