Support table-qualified column names in --skip-columns and --include-columns#214
Open
Support table-qualified column names in --skip-columns and --include-columns#214
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…columns Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Clarify allowed values for --skip-columns and --include-columns
Support table-qualified column names in --skip-columns and --include-columns
Mar 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates wp search-replace to treat --skip-columns and --include-columns entries as matching either unqualified column names (column) or table-qualified names (table.column), fixing the long-standing behavior where qualified names were silently ignored.
Changes:
- Extend include/skip column matching in the main processing loop to also recognize
table.column. - Apply the same qualified matching in the SQL export (PHP) path and add missing
--include-columnshandling there. - Update command option docs and add Behat coverage for table-qualified include/skip usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Search_Replace_Command.php |
Adds table-qualified matching for include/skip columns in both processing and export paths; updates option docs. |
features/search-replace.feature |
Adds acceptance tests ensuring table.column works for --skip-columns and --include-columns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+618
to
+622
| if ( ! empty( $this->include_columns ) && ! in_array( $col, $this->include_columns, true ) && ! in_array( $table . '.' . $col, $this->include_columns, true ) ) { | ||
| $row_fields[ $col ] = $value; | ||
| continue; | ||
| } | ||
| if ( $value && ! in_array( $col, $primary_keys, true ) && ! in_array( $col, $this->skip_columns, true ) && ! in_array( $table . '.' . $col, $this->skip_columns, true ) ) { |
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.
--skip-columnsand--include-columnssilently ignored table-qualified column names likewp_posts.guid, with no documentation indicating this format was unsupported. This adds first-class support for thetable.columnsyntax.Changes
include_columnsandskip_columnschecks now match againstcolumnandtable.columnformatsinclude_columnsfiltering (pre-existing omission)Usage
Plain column names (e.g.
--skip-columns=guid) continue to work as before and match across all tables.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.