Skip to content

fix(adapter): Remove manual Identity Map updates #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025

Conversation

octet-stream
Copy link
Owner

@octet-stream octet-stream commented Jul 9, 2025

Details

Previously I've been managing Identity Map in adapter.deleteMany method to keep data fresh after rows been deleted. This PR fixes adapter.deleteMany method by replacing orm.em.nativeDelete + orm.em.clear combination, now Identity Map updates will be handled by Mikro ORM itself. It also updates adapter.delete method to minimize loading data, because we only need a reference with a row ID.

Fixes #15

Changes

  • Replace nativeDelete with remove method;
  • Only load rows IDs.

Checklist

  • I have self-reviewed my changes before asking for a review from maintainers
  • I have added changesets
  • I have brought tests
  • I have updated the documentation

@octet-stream octet-stream self-assigned this Jul 9, 2025
@octet-stream octet-stream added the bug Something isn't working label Jul 9, 2025
Copy link

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: fcbe580

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@octet-stream octet-stream merged commit 758164e into main Jul 9, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Jul 9, 2025
@octet-stream octet-stream deleted the fix/delete-many-identity-map branch July 12, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adapter.create fails if used after adapter.deleteMany.
1 participant