soft-delete

Implement soft delete patterns with deleted_at timestamps in TypeScript, JavaScript, and Python.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill soft-delete
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: soft-delete
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/soft-delete
Command: npx skills add https://github.com/dadbodgeoff/drift --skill soft-delete

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents accidental data loss and maintains audit trails by implementing a soft delete pattern, allowing for data recovery and restoration.

Core Features & Use Cases

  • Data Recovery: Easily restore accidentally deleted records.
  • Audit Trails: Maintain a history of deleted items for compliance and review.
  • Referential Integrity: Preserve relationships between data even after "deletion".
  • Use Case: Implement soft delete for user accounts, allowing them to be restored within a GDPR-defined recovery period before permanent deletion.

Quick Start

Use the soft-delete skill to restore the user with ID '123' that was previously deleted.

Frequently Asked Questions about soft-delete

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a soft delete pattern for database records?

To implement a soft delete pattern, you need database schema modifications and application-level logic to manage deleted_at timestamps. This approach enables data recovery and maintains audit trails by marking records as deleted instead of permanently removing them.

How do I restore accidentally deleted database records for compliance and audit trails?

Restoring accidentally deleted records is handled through a restoration workflow that uses the deleted_at timestamp. This soft delete mechanism maintains audit trails and preserves referential integrity, allowing you to recover data within a defined period like GDPR compliance windows.

How do I filter out soft deleted records in TypeScript and Python applications?

Filtering soft deleted records in TypeScript and Python requires application-level logic to exclude entries where the deleted_at timestamp is set. This ensures active queries ignore recovered or archived data while maintaining the audit trail.

Does implementing a soft delete pattern require database schema modifications?

Yes, implementing a soft delete pattern requires database schema modifications to add columns like deleted_at. You must also update application-level logic across TypeScript/JavaScript and Python environments to handle filtering, restoration, and permanent deletion workflows.

What is the best way to permanently delete records after a soft delete recovery period?

The best way to permanently delete records after a soft delete recovery period is through a dedicated permanent deletion workflow. This process removes the database entries entirely once the deleted_at timestamp indicates the compliance or recovery window has expired.

When should I not use a soft delete approach for data management?

You should not use a soft delete approach when data privacy regulations demand immediate and permanent removal of records. Because soft delete preserves data for audit trails and recovery, it fails to meet strict erasure requirements unless paired with a scheduled permanent deletion workflow.