objectbox / objectbox/objectbox-dart

Add objects to ToMany by ID only

Open
#532 3 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Dart
Stars
1.2k
Forks
162
Avg merge
15m
Merged PRs (30d)
1

Description

Hello,

It should be very useful to have inside ToMany class a method addId to add the entity reference directly by the id.
Now have just add that force the programmer to insert a whole entity.
But in many case what have are the ids and this force to load all the related entities before can add them as relations.

the ToOne already provide this function passing by targetId.

Thanks
Sam

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the ToMany API and the existing ToOne targetId behavior. Determine how an ID-only addition should represent a related entity without loading it, then verify that the new API preserves relation behavior and does not require fetching all related objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.