canal: parse ignore_tables as a TOML sub-table (#1143)#1146
Conversation
Switch DumpConfig.IgnoreTables from []string with home-grown "db,table" splitting to map[string][]string so the TOML decoder handles the db -> tables mapping directly. This also lets db names contain dots when quoted, e.g. "weird.db.name" = ["other"]. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the IgnoreTables configuration from a slice of strings to a map of string slices, enabling better support for TOML sub-tables and database names containing dots. The logic in canal.go has been updated to iterate through the new map structure, and a unit test was added to verify the configuration parsing. The review feedback identifies this as a breaking change for existing users and recommends documenting it in the release notes or migration guide.
| // [dump.ignore_tables] | ||
| // mydb = ["t1", "t2"] | ||
| // "weird.db.name" = ["other"] | ||
| IgnoreTables map[string][]string `toml:"ignore_tables"` |
There was a problem hiding this comment.
The change from []string to map[string][]string for IgnoreTables is a breaking change for existing configuration files. While this is intentional to support TOML sub-tables and database names with dots, it will cause the TOML decoder to fail for users with the old configuration format. Please ensure this is documented in the release notes or migration guide.
There was a problem hiding this comment.
How about we add a new config item to keep compatibility? I think we don't bother fix the , problem of old config, just advise developers to use the new one.
Switch DumpConfig.IgnoreTables from []string with home-grown "db,table" splitting to map[string][]string so the TOML decoder handles the db -> tables mapping directly. This also lets db names contain dots when quoted, e.g. "weird.db.name" = ["other"].
Closes #1143