joist-orm / joist-orm/joist-orm

Avoid loading soft-deleted records from the db

Open
#479 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.