NestJS · Senior · Question 64 of 75
How would you implement soft-delete filtering globally with TypeORM in Nest?
- 1Soft delete isn't possible with TypeORM
- 2Add
WHERE deleted_at IS NULLmanually to every query - ✓Correct answer: Use TypeORM's
@DeleteDateColumnandsoftDelete, which exclude soft-deleted rows from finds by default
Explanation
Unique constraints still need care (partial indexes), and raw queries don't apply the filter automatically.