|
| 1 | +# Row Compare |
| 2 | + |
| 3 | +Compare rows using a dataset YAML with file inputs |
| 4 | + |
| 5 | +## Command |
| 6 | + |
| 7 | +```bash |
| 8 | +sqlcompare dataset tests/datasets/row_compare/dataset.yaml |
| 9 | +``` |
| 10 | + |
| 11 | +## Output |
| 12 | + |
| 13 | +```text |
| 14 | +Prepared dataset tables: sqlcompare.dataset_dataset_998aa249_previous, sqlcompare.dataset_dataset_998aa249_new |
| 15 | +✅ Ensured schema 'sqlcompare' exists |
| 16 | +Joining tables: sqlcompare.dataset_dataset_998aa249_previous and sqlcompare.dataset_dataset_998aa249_new |
| 17 | +Rows only in current dataset: 1 |
| 18 | ++----+-------+--------+--------+ |
| 19 | +| id | name | amount | status | |
| 20 | ++----+-------+--------+--------+ |
| 21 | +| 4 | delta | 40 | open | |
| 22 | ++----+-------+--------+--------+ |
| 23 | +Rows only in previous dataset: 1 |
| 24 | ++----+-------+--------+--------+ |
| 25 | +| id | name | amount | status | |
| 26 | ++----+-------+--------+--------+ |
| 27 | +| 2 | bravo | 20 | open | |
| 28 | ++----+-------+--------+--------+ |
| 29 | +🚨 Differences in values for common rows: 2 rows in total |
| 30 | +
|
| 31 | +📊 Difference statistics by column: |
| 32 | ++-------------+------------+ |
| 33 | +| COLUMN_NAME | diff_count | |
| 34 | ++-------------+------------+ |
| 35 | +| amount | 1 | |
| 36 | +| name | 1 | |
| 37 | ++-------------+------------+ |
| 38 | +
|
| 39 | +✅ Columns with no differences: status |
| 40 | +
|
| 41 | +📋 Sample differences (first 10 rows): |
| 42 | ++----+--------+--------+---------+ |
| 43 | +| id | COLUMN | BEFORE | CURRENT | |
| 44 | ++----+--------+--------+---------+ |
| 45 | +| 1 | name | alpha | alfa | |
| 46 | +| 1 | amount | 10 | 11 | |
| 47 | ++----+--------+--------+---------+ |
| 48 | +🔎 To review the diff, run: sqlcompare analyze-diff compare_sqlcompare_dataset_dataset_998aa249_previous_sqlcompare_dataset_dataset_998aa249_new_20260104_025829_b28946b5 |
| 49 | +💡 Tips: --stats for per-column counts, --missing-current/--missing-previous for row-only, --column <name> to filter, --list-columns to inspect available fields. |
| 50 | +``` |
0 commit comments