Problem
The soft-deletes section of docs/delete.md documented three things the query builder doesn't do:
| Documented | Actual |
|---|---|
Enable with softDeletes: true on a model entry | Nothing reads that. The builder's filter comes from setConfig({ softDeletes: { enabled, column, defaultFilter } }); models use traits: { useSoftDeletes: true } |
db.remove('users', 1) soft-deletes, "sets deleted_at = NOW()" | It's a real DELETE. The Force Delete section a few lines later says so |
db.deleteFrom('users').onlyTrashed().forceDelete().execute() | Neither method exists on deleteFrom(); the call throws |
Change
- The section now says the builder only filters marked rows, and shows the config that turns the filter on.
- Marking a row goes through
updateTable().set({ deleted_at }). The model-layer calls that mark instead of removing are linked from here. - Force delete now shows
deleteFrom().whereNotNull('deleted_at')andUser.onlyTrashed().delete()(the purge from #1111).
Every snippet in the rewritten sections was executed against SQLite, including withTrashed()/onlyTrashed(), both restore paths, and db.remove() removing the row. Docs lint passes (7/7).
Found along the way, not fixed here
docs-lint's "only documents builder methods that exist" rule checks only db.method( calls on a single line, so a method on a continuation line ( .forceDelete()) is never checked. That's how this example got through. Extending the rule to continuation lines turns up 22 more hits across the docs: .whereMonth(), .whereJson(), .forUpdate(), .increment() on updateTable(), and others. Some may be methods the check can't see, so that needs its own pass.
🤖 Generated with Claude Code