Skip to content

[Regression][SQLite] Insert + On Conflict Do Nothing = error  #1549

@andoriyu

Description

@andoriyu

Description

In SeaORM prior 0.11, running the following query twice works fine:

INSERT INTO \"group_user_membership\" (\"user_id\", \"group_id\") VALUES ('01GVEMDSKK33QX8ET4601B4HG7', '00000000000000000000000000') ON CONFLICT (\"group_id\", \"user_id\") DO NOTHING"

Running it on 0.11.x results in DbErr::RecordNotInserted

Steps to Reproduce

  1. Insert a record
  2. Insert a conflicting record instructing to do nothing on conflict

Expected Behavior

No error, not records inserted.

Actual Behavior

Get an error: DbErr::RecordNotInserted

Reproduces How Often

Every single time.

Workarounds

Check for DbErr::RecordNotInserted prior bubbling error up the stack.

Reproducible Example

https://github.com/andoriyu/seaorm-issues/blob/main/src/lib.rs#L39-L53

Versions

0.11.0 and 0.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions