Skip to content

Add 'data pkg cleanup' to delete records from a CMT package#134

Open
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/data-pkg-cleanup
Open

Add 'data pkg cleanup' to delete records from a CMT package#134
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/data-pkg-cleanup

Conversation

@zekelinAlex
Copy link
Copy Markdown

Closes #122.
Adds txc data pkg cleanup <path>. Point it at the same CMT package you
imported and it deletes those records back out of the environment.
How it works:

  • parses data.xml + data_schema.xml (folder or .zip, same shapes import accepts)
  • walks entities in reverse <entityImportOrder> so children come down before parents
  • disassociates <m2mrelationship> pairs first so endpoints can be deleted cleanly
  • batches DeleteRequest through ExecuteMultiple; on ObjectDoesNotExist, falls back to QueryExpression against the schema's primarynamefield plus every updateCompare="true" field
  • shards entities across N parallel ServiceClients when --connection-count > 1
    Flags mirror import where they make sense, plus --dry-run,
    --missing-action, and the usual --yes since it's destructive.
    Also noticed data pkg convert was never wired into the command tree, so
    it was unreachable from the CLI. One-line fix in the same file.
    Tests cover the parser (folder + zip + m2m), command input validation,
    and a help-text smoke test.

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.

Implement data package cleanup

1 participant