objectbox / objectbox/objectbox-dart

Watching a single entity change

Open
#779 1 comment 3 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

When watch a query, the query is triggered when any changes happened.
Want trigger happens only the specified entity changed.

Just like Drift's feature Stream watchSingle(): Watches the query, asserting that a single row is reported each time the query runs.
Stream<T?> watchSingleOrNull(): Like watchSingle(), but returning empty result sets as null.

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 tracing the query watch API and how it determines which entity changes trigger notifications. Define the single-entity and empty-result behavior described in the issue, then verify that the resulting API and tests distinguish changes to the specified entity from unrelated changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.