Skip to content

Remapping Keys as Config Option - #169

Open
GALHP wants to merge 18 commits into
clonio-dev:mainfrom
GALHP:feat/remapping-keys-as-config-option
Open

Remapping Keys as Config Option#169
GALHP wants to merge 18 commits into
clonio-dev:mainfrom
GALHP:feat/remapping-keys-as-config-option

Conversation

@GALHP

@GALHP GALHP commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Adds an options.remap_keys boolean (default true) that toggles key-remapping
generation, plus a cloning:dump --skip-remapping-keys flag that persists it.
The cloning:run --skip-remapping-keys flag is unchanged.

Stacked PR — base: feat/regex-table-names · 5th of 6 · Part of #164.
No code dependency on #165#168 (stacked only)

Motivation

Remapping can only be disabled per-run via --skip-remapping-keys, repeated
every 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 (default true) — CloningOptionsData.remapKeys,
    parsed in CloningYamlLoader, validated as an optional boolean in
    CloningYamlValidator.
  • cloning:run — skips remapping when the flag is set or
    remap_keys: false (OR); the flag is unchanged and threaded through the
    option-override rebuild so it survives --enforce-*/--drop-*.
  • cloning:dump --skip-remapping-keys — writes remap_keys: false (default
    true), mirroring the existing dump flags and adding a "Remap keys?" prompt;
    DumpResultData + CloningYamlWriter emit the field.
  • Docs: docs/cloning-yaml.md, docs/commands/cloning-dump.md,
    docs/commands/cloning-run.md, specs/PRD-cloning-yaml-schema.md.

Positive naming (remap_keys, not skip_*) reads better persisted; default
true keeps existing configs behaving exactly as before. remap_keys: false
keeps 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 against
SQLite.

@GALHP GALHP changed the title Feat/remapping keys as config option Remapping Keys as Config Option Aug 13, 2026
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.

1 participant