Skip to content

feat(schema): tx schema sync — add new source columns to the model #433

Description

@bgarcevic

Part of #424. Size: M · Depends on: #428

What are you trying to do?

Apply the safe part of a schema check: add the new source columns to the model, like Desktop's Refresh does, without a full re-import.

What do we do today?

tx schema check (#428) reports drift. Fixing it means a tx add … -t DataColumn for each column, by hand.

What would tx do?

tx schema sync [model] [--table <name>]... [--save | --stage] [--dry-run]
  • Added columns: creates each added column as a DataColumn with its name (after any M rename), sourceColumn and mapped dataType. It runs through MutationRunner, so --save, --stage, the preview and live-session undo all work. A run is one transaction labelled "schema sync".
  • Never removes columns. removed findings are reported with their dependants, and the exit code is non-zero.
  • typeChanged: only applied with --types, and listed in the preview.
  • notSelected (the M projects the column out): not added. It reports the M edit that would be needed. Rewriting M comes later.

Acceptance criteria

  • sync followed by check reports no added columns.
  • --dry-run matches the mutation preview format of the other modify commands.
  • Docs and the command surface snapshot are updated.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:modifyadd, set, mv, rm, replace, format, script, incremental-refreshenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions