Skip to content

Delete: prompt=True for development; preview, then delete(prompt=False) in production - #312

Open
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/delete-prompt-guidance
Open

dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/delete-prompt-guidance

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

Documents the decision on datajoint/datajoint-python#1682: delete() keeps its behavior, prompt=True is for interactive development and prototyping, and production code previews the delete and then calls delete(prompt=False). Matches the delete() docstring change in datajoint/datajoint-python#1690.

  • How-to, Delete Data: a new "Interactive and Production Deletes" section. It covers the confirmation prompt for development, with a warning that the prompt waits inside an open transaction, and production deletes (preview with Diagram.cascade().counts(), then delete(prompt=False), with the same part_integrity). "Inspecting Cascade Before Deleting" adds iterating the cascade to see the rows. The transaction-handling notes say that transaction=False asks no confirmation and does not roll back.
  • Data-manipulation spec: 4.4 (Safe Mode) states the prompt answers and the open transaction; 4.5 and the new 9.5 (Deletion in Production) give the production pattern.
  • Explanation, Transactions: corrects when transaction=False is needed, and what it means.
  • Tutorial, Data Entry: the delete section shows the preview, then prompt=False.
  • What's new in 2.2: a "Current guidance" note above the Safe Delete Workflow, which replaces its advice that the prompt is safer than a preview.

Every statement and code example was checked against MySQL and PostgreSQL. mkdocs build --strict, the link check and codespell pass.

…oduction

delete(prompt=True) asks for confirmation while the delete transaction is
still open, so it is meant for interactive development. In production,
preview with dj.Diagram.cascade(...) using the same part_integrity, then
call delete(prompt=False). Update the delete how-to (including iterating
the cascade to see the rows), the data manipulation spec (sections 4.4,
4.5, and 9.5), the transactions explanation, the data entry tutorial's
best practice, and add a current-guidance note to the 2.2 release notes.

Refs datajoint/datajoint-python#1682

This branch has not been deployed

No deployments
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