Remapping Keys as Config Option - #169
Open
GALHP wants to merge 18 commits into
Open
Conversation
6 tasks
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
Adds an
options.remap_keysboolean (defaulttrue) that toggles key-remappinggeneration, plus a
cloning:dump --skip-remapping-keysflag that persists it.The
cloning:run --skip-remapping-keysflag is unchanged.Motivation
Remapping can only be disabled per-run via
--skip-remapping-keys, repeatedevery run. Some of our projects use frameworks that don't consistently declare
relational keys (many cross-references aren't real FKs), so we need to disable
remapping persistently in the config, not just the CLI.
What's changed
options.remap_keys(defaulttrue) —CloningOptionsData.remapKeys,parsed in
CloningYamlLoader, validated as an optional boolean inCloningYamlValidator.cloning:run— skips remapping when the flag is set orremap_keys: false(OR); the flag is unchanged and threaded through theoption-override rebuild so it survives
--enforce-*/--drop-*.cloning:dump --skip-remapping-keys— writesremap_keys: false(defaulttrue), mirroring the existing dump flags and adding a "Remap keys?" prompt;DumpResultData+CloningYamlWriteremit the field.docs/cloning-yaml.md,docs/commands/cloning-dump.md,docs/commands/cloning-run.md,specs/PRD-cloning-yaml-schema.md.Positive naming (
remap_keys, notskip_*) reads better persisted; defaulttruekeeps existing configs behaving exactly as before.remap_keys: falsekeeps the remapping definition (so it can be re-enabled) — it only skips
generation, not the
strategy: remapping/key_remapping:config.Testing
Units: loader (true/false/absent→true), validator (non-bool rejected), writer
(emits the line), DTO. Feature:
DumpCommandTest(flag + prompt),RunCommandTest(config false/true + OR-with-flag). Verified end-to-end againstSQLite.