Regex Table Names - #168
Open
GALHP wants to merge 15 commits into
Open
Conversation
This was referenced Aug 13, 2026
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
Lets a
tables:key in a.cloning.yamlbe a slash-delimited regex insteadof only an exact name; at run time each regex expands against the real source
tables, so one entry configures a whole family.
Motivation
Our schemas have many similarly-named tables — shared prefixes/suffixes, dynamic
datetime suffixes (
application_logs_archive_02_2026,…_03_2026, …). Listingeach is verbose and needs re-editing as tables appear. One regex configures them
all and makes configs reusable across stages.
What's changed
App\Services\Cloning\TableConfigResolver(new) — after schema inspection,expands table keys against the real source tables and returns a config whose
tablesall carry concrete names, so the orchestrator,getTable(),dependency sort, and audit code work unchanged.
RunCommand— invokes the resolver right afterSchemaInspector::inspect().CloningYamlValidator— rejects a non-compiling regex key in Phase-1,before any DB work.
docs/cloning-yaml.md,specs/PRD-cloning-yaml-schema.md.Semantics
/…/(trailing flags allowed) = regex; anything else = literal. No glob/*(regex covers it via
.*)./…/-vs-literalconvention (
PiiMatcherSetData::matchesPattern()).with a narrower regex/literal.
nothing is skipped.
--skip-tables/--only-tables(literal-only) — documented.\d,\w, … aren't eaten as escapes.Testing
TableConfigResolverTest(expansion, last-match-wins, literal-not-foundpreserved, skip expansion, no-match ignored, all-literal backward-compat,
case-insensitivity) + validator coverage for an invalid regex key. Verified
end-to-end against SQLite.