Skip to content

Adds upsert entity operations using ON CONFLICT#428

Open
jlavelle wants to merge 1 commit intomainfrom
nebula/upsert
Open

Adds upsert entity operations using ON CONFLICT#428
jlavelle wants to merge 1 commit intomainfrom
nebula/upsert

Conversation

@jlavelle
Copy link
Member

@jlavelle jlavelle commented Feb 7, 2026

Added variations of the insert* entity operations that use ON CONFLICT <target> DO UPDATE clauses to update values that conflict due to a constraint violation.

Added variations of the `insert*` entity operations that use `ON
CONFLICT <target> DO UPDATE` clauses to update values that conflict due
to a constraint violation.
Copy link
Member

@qxjit qxjit left a comment

Choose a reason for hiding this comment

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

I think this is a great addition to the API. I think we should consider what the shape of the Expr.ConflictTargetExpr should be at the EntityOperation layer of the interface. In particular, I'd like it to be very straightforward for a new user to do an upsert by primary key without worrying about the the Expr API.

@telser telser requested a review from qxjit February 10, 2026 19:08
Expr.ConflictTargetExpr ->
NEL.NonEmpty writeEntity ->
m [readEntity]
upsertAndReturnEntities tableDef target = do
Copy link
Contributor

Choose a reason for hiding this comment

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

The do here is redundant

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