SQLite Forum

Suggestion for sqldiff
Login
For grins, I made sqldiff accept another option whose usage tip reads:<code>
    --skipcolumn COL      Ignore column COL differences
</code>

Here is an example of its action:
<code>
C:\Users\brasf>sqlite3m -batch db1.sdb "select * from Pets"
name    species lastMeal
Fido    dog     17:54
Fluffy  cat     17:49
Slither snake   15 days ago

C:\Users\brasf>sqlite3m -batch db2.sdb "select * from Pets"
name    species lastMeal
Fido    dog     17:54
Fluffy  cat     17:48
Slither serpent 16 days ago

C:\Users\brasf>sqldiff db1.sdb db2.sdb
UPDATE Pets SET lastMeal='17:48' WHERE rowid=2;
UPDATE Pets SET species='serpent', lastMeal='16 days ago' WHERE rowid=3;

C:\Users\brasf>sqldiff -skipcolumn lastMeal db1.sdb db2.sdb
UPDATE Pets SET species='serpent' WHERE rowid=3;
</code>

Here are <u>[Diffs of Changes to tool/sqldiff.c](https://drive.google.com/file/d/1w-UxC9Y3s_VZDX_q5jdONFtNaVOGgOif/view?usp=sharing)</u>.

The option is not paired with table selection.  The to-be-ignored column is ignored in any table which has the named column.  It is only ignored of not part of a primary key. To restrict the ignoring to a single table, the (preexisting) --table option must be used.