feat(filtering): fine-grained table, column, row, and scope filtering#169
Merged
jasdeepkhalsa merged 2 commits intomasterfrom Apr 3, 2026
Merged
feat(filtering): fine-grained table, column, row, and scope filtering#169jasdeepkhalsa merged 2 commits intomasterfrom
jasdeepkhalsa merged 2 commits intomasterfrom
Conversation
…#164) Add fine-grained control over what enters the diff comparison: - **Table include list** (`tables` / `--tables`): only diff matching tables - **Table exclude list** (`tablesToIgnore` / `--ignore-tables`): skip tables entirely (enhanced with glob support) - **Data-only exclude** (`tablesDataToIgnore`): skip data diff while keeping schema diff - **Column exclusion** (`fieldsToIgnore`): per-table column skipping (keys now support glob patterns) - **Row filtering** (`rowsToIgnore`): skip rows matching a column-value regex, per table - **Scope override** (`tableScope`): override diff scope to `schema`, `data`, or `all` per table All list values support glob patterns (`*`, `?`) for flexible matching. New `TableFilter` utility class centralises all filtering logic — stateless, glob-aware, tested in isolation. Closes #164
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Implements #164 — fine-grained control over what enters the diff comparison across four dimensions.
What's New
Table filtering
tables(+--tablesCLI flag) — include list: only diff tables matching these names/globstablesToIgnore(+--ignore-tablesCLI flag) — exclude list: skip tables entirely (now supports glob patterns)tablesDataToIgnore— exclude from data diff only; schema is still comparedColumn filtering
fieldsToIgnore— per-table column exclusion. Keys now support glob patterns (wp_*,audit_?), so one rule can cover multiple tables.Row filtering
rowsToIgnore— per-table list of{ column, pattern }rules. Rows wherecolumnmatches the regexpatternare skipped from the data diff.Scope override
tableScope— override diff scope per table toschema,data, orall.All list values support glob patterns:
*(any chars),?(single char).Implementation
TableFilterutility class (src/Params/TableFilter.php) — centralises all filtering logic, stateless, glob-aware, fully unit tested.DefaultParamsand parsed from config/CLI.DBSchemaandDBDataupdated to use glob-awareTableFilter::filterTables().TableSchema,LocalTableData,DistTableData,ArrayDiffupdated to useTableFilter::getFieldsToIgnore()(now glob-aware for keys).StreamingMergeDiff,LocalTableData,TableDataupdated to applyrowsToIgnorefiltering.Tests
tests/Unit/TableFilterTest.phpcovering all filtering paths: include/exclude combination, glob matching, field resolution, row rule matching, regex edge cases.StreamingMergeDiffTest— addedParamsFactorysetup so row-filter code path is safe to call in tests.Configuration example
CLI