Skip to content

Add optional soft delete support#2032

Closed
Sakura0122 wants to merge 1 commit into
fastapi:mainfrom
Sakura0122:codex/soft-delete-query-filter
Closed

Add optional soft delete support#2032
Sakura0122 wants to merge 1 commit into
fastapi:mainfrom
Sakura0122:codex/soft-delete-query-filter

Conversation

@Sakura0122

Copy link
Copy Markdown

Pull Request

Discussion: #1890

Description

This follows up on #1890, which was closed due to inactivity.

This PR adds optional soft delete support with:

  • SoftDeleteMixin, using deleted_at by default
  • SoftDeleteSession.delete(), which marks soft-deletable models as deleted
  • default filtering for SoftDeleteSession.exec(select(...))
  • include_deleted=True to include soft-deleted rows
  • custom soft delete field support with __soft_delete_field__

Compared with #1890, this keeps the change scoped to the soft delete feature and adds query filtering support.

Checklist

  • This PR links to a GitHub Discussion for the proposed code change.
  • I added tests for the change.
  • The new or updated tests fail on the main branch and pass on this PR.
  • Coverage stays at 100%.
  • The documentation explains the change if needed.

@YuriiMotov

Copy link
Copy Markdown
Member

Thanks for your interest!

We've recently updated contribution guidelines and PR description template, now we ask people not to open PRs unless maintainers explicitly ask to do it (see).

If you are interested in this feature being added to SQLMOdel, please open a discussion or find existing one and upvote\comment on it

@YuriiMotov YuriiMotov closed this Jul 6, 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.

3 participants