Skip to content

feat(db): add conflict tolerant inserts to query builder and QBMapper - #64772

Open
Koc wants to merge 4 commits into
masterfrom
feature/insert-ignore-conflicts
Open

Koc wants to merge 4 commits into
masterfrom
feature/insert-ignore-conflicts

Conversation

@Koc

@Koc Koc commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds QBMapper::insertIgnoreConflict() to insert entities while ignoring conflicts. Unlike insertOrUpdate(), it leaves existing rows unchanged and avoids PostgreSQL duplicate-key error logs for expected conflicts. Use case can be found at nextcloud/collectives#2743

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Koc added 2 commits September 26, 2026 17:06
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc
Koc marked this pull request as ready for review September 26, 2026 15:39
@Koc
Koc requested a review from a team as a code owner September 26, 2026 15:39
@Koc
Koc requested review from Altahrim, CarlSchwan, come-nc and provokateurin and removed request for a team September 26, 2026 15:39
@CarlSchwan

Copy link
Copy Markdown
Member

What is the usecase?

@Koc

Koc commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@CarlSchwan please check linked issue nextcloud/collectives#2743 in Collective app

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why the refactor in QueryBuilder and Connection.
You only needed support for insertIgnoreConflict in the Mapper, no?
It was already supported in the query builder.

@come-nc

come-nc commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Also why is insertOrUpdate not enough?

… (code review)

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc
Koc force-pushed the feature/insert-ignore-conflicts branch from 486803a to 55316e7 Compare October 12, 2026 21:43
@Koc

Koc commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@come-nc I've simplified PR and updated description with an explanation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants