joist-orm / joist-orm/joist-orm
Avoid loading soft-deleted records from the db
Open
enhancement
- Dominant language
- TypeScript
- Stars
- 385
- Forks
- 26
- Avg merge
- 8h 55m
- Merged PRs (30d)
- 42
Description
Today Joist loads soft-deleted records from the db (in `em.find` or `o2m.load()` queries) but then filters them out in-memory.
This is generally on purpose due to:
- Ease of implementation, and
- Means `.getWithDeleted` can stay synchronous and not need `await`-d if business logic ends up needing the soft-deleted rows
That said, it's possible to change this behavior, albeit with a breaking API change to the `.getWithDeleted` functionality (it may end up being a new `.getWithSoftDeleted` async method).
No plans on implementing this right now, but just filing the issue for tracking purposes.
Contributor guide
Assessment
This issue has not been assessed yet.