Skip to content

Mark updated rows on conflict #100

Open
@IlyaSemenov

Description

@IlyaSemenov

Currently with on_conflict(...).insert(...) (as well as insert_and_get and bulk_insert) there is no way to know which rows were inserted and which have been updated in-place (unlike Django's update_or_create which returns a tuple of obj, created).

However, Postgres provides such trick with RETURNING *, (xmax = 0) (see https://stackoverflow.com/a/47001830/189806).

It would be great if that was supported natively by the library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions