Ask HN: Why don't apps/websites have an undelete button?
Do we just not need an "undo" button? It's an interesting question. There's been previous posts around "soft-delete" and not needing it. Then again whey are there so many ORM's that do this? Why do we have time travel is databases?
3 comments
[ 5.0 ms ] story [ 18.7 ms ] threadIt also makes things like GDPR and erasing people's data a little harder (although not much).
Hard delete also frees resources immediately, which can save some money at scale.
And, ultimately, most users don't expect it in a web app, so you can save time by not building it.
Yet so many ORM's come with "soft-delete" built-in:
- [Golang Bun](https://bun.uptrace.dev/guide/soft-deletes.html#introduction) Lightweight Golang ORM for PostgreSQL, MySQL, MSSQL, and SQLite
- [Golang GORM](https://gorm.io/docs/delete.html#Soft-Delete) The fantastic ORM library for Golang
- [Typescript DeepKit](https://docs.deepkit.io/english/database.html#_plugins) High performance typescript framework
- [Java Spring](https://www.baeldung.com/spring-jpa-soft-delete) How to Implement a Soft Delete with Spring JPA
- [Typescript TypeOrm](https://doug-martin.github.io/nestjs-query/docs/persistence/...) Easy CRUD for GraphQL
- [Typescript Sequalize](https://sequelize.org/docs/v6/core-concepts/paranoid/) Sequelize is a modern TypeScript and Node.js ORM for Oracle, Postgres, MySQL, MariaDB, SQLite and SQL Server, and more.
- [Typescript Prisma](https://www.prisma.io/docs/concepts/components/prisma-client...) Next-generation Node.js and TypeScript ORM
- [Rust](https://docs.rs/diesel-softdelete/latest/diesel_softdelete/) Diesel query builder
- [Python Django](https://github.com/scoursen/django-softdelete) Soft delete for Django ORM, with support for undelete
GDPR is a good point. Also, do people really go back and delete?