objectbox / objectbox/objectbox-dart

Return ID in UniqueViolationException

Open
#310 2 comments 0 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

I am working with entities that specify a Unique ID I get from an external system.

These entities are nested, thus resulting in UniqueViolationException when I try to update values that already exist.

Is it possible to return the conflicting ID that is also displayed in the error message from the UniqueViolationException as a value in the exception?

Is there any other, more elegant, way to work with external unique IDs and bulk updates?

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 UniqueViolationException implementation and the bulk update path described in the issue. Determine whether the conflicting ID can be exposed through the exception, or whether external unique IDs require a different documented workflow; done means a decided API or alternative with corresponding coverage.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.