Skip to content

Add glob wildcard support to NoData and Ignore table filters#1093

Merged
Soner (shyim) merged 1 commit into
mainfrom
claude/clever-darwin-wohsah
Jun 11, 2026
Merged

Add glob wildcard support to NoData and Ignore table filters#1093
Soner (shyim) merged 1 commit into
mainfrom
claude/clever-darwin-wohsah

Conversation

@shyim

Copy link
Copy Markdown
Member

Summary

Adds support for glob wildcard patterns (e.g., customer*, *_archive, old_?) in the NoData and Ignore table filter lists for database dumps. This allows users to match multiple tables with a single pattern instead of listing each table individually.

Key Changes

  • New expandTablePattern() function: Expands glob patterns against the actual table list, supporting *, ?, and [...] wildcards. Patterns without wildcards are returned verbatim to allow non-existent table names. Matching is case-insensitive.
  • New buildFilterMap() function: Builds the filter map by expanding all patterns in NoData and Ignore lists. Ignore patterns take precedence when both match a table.
  • Updated Dumper.Dump() method: Now uses buildFilterMap() to process patterns instead of simple string mapping.
  • Documentation updates: Updated comments in ConfigDump struct and JSON schema to indicate wildcard support.

Implementation Details

  • Uses Go's path.Match() for glob pattern matching (standard library)
  • All table names and patterns are normalized to lowercase for case-insensitive matching
  • Invalid patterns (e.g., unclosed brackets) return an error with context
  • Comprehensive test coverage including:
    • Pattern expansion with various wildcard types
    • Filter map building with overlapping patterns
    • Integration tests for wildcard-based ignore and nodata filters
    • Error handling for invalid patterns

https://claude.ai/code/session_012P9LW5x7MB5vS3jaUB4m6c

Table entries in the dump configuration (nodata and ignore) can now
contain glob wildcards like 'customer*' or 'order*'. Patterns are
expanded against the actual table list of the database, matching
case-insensitively. Entries without wildcards keep behaving as exact
names.

Fixes #1089

https://claude.ai/code/session_012P9LW5x7MB5vS3jaUB4m6c
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go-test

The overall coverage in the branch remains at 54%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File d2522e6 b469fb3 +/-
internal/mysqldump/schema.go 85% 85% 0%
internal/mysqldump/mysql.go 60% 63% +3%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@shyim Soner (shyim) marked this pull request as ready for review June 11, 2026 09:44
@shyim Soner (shyim) merged commit 6ebf84d into main Jun 11, 2026
5 checks passed
@shyim Soner (shyim) deleted the claude/clever-darwin-wohsah branch June 11, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants