Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres, RecordNotFound Error: Failed to find inserted item #2389

Open
lcmgh opened this issue Oct 9, 2024 · 1 comment
Open

postgres, RecordNotFound Error: Failed to find inserted item #2389

lcmgh opened this issue Oct 9, 2024 · 1 comment

Comments

@lcmgh
Copy link

lcmgh commented Oct 9, 2024

Caused by:
0: unable to insert dsi_messages into database
1: RecordNotFound Error: Failed to find inserted item

primary key is a String

pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: String,
 my_message::Entity::insert_many(
            my_messages.inspect(|e| debug!("Message to write to database: {:?}", e)),
        )
        .on_empty_do_nothing()
        .on_conflict(OnConflict::column(Column::Id).do_nothing().to_owned())
        .exec_with_returning(self.database.as_ref())
        .await
        .wrap_err("unable to insert my_messages into database")?;

version

├── sea-orm v1.1.0-rc.1
│   ├── sea-orm-macros v1.1.0-rc.1 (proc-macro)
│   │   ├── sea-bae v0.2.1 (proc-macro)
│   ├── sea-query v0.32.0-rc.1
│   │   ├── sea-query-derive v0.4.1 (proc-macro)
│   ├── sea-query-binder v0.7.0-rc.2
│   │   ├── sea-query v0.32.0-rc.1 (*)
├── sea-orm-migration v1.1.0-rc.1
│   ├── sea-orm v1.1.0-rc.1 (*)
│   ├── sea-orm-cli v1.1.0-rc.1
│   │   ├── sea-schema v0.16.0-rc.1
│   │   │   ├── sea-query v0.32.0-rc.1 (*)
│   │   │   └── sea-schema-derive v0.3.0 (proc-macro)
│   ├── sea-schema v0.16.0-rc.1 (*)
├── sea-orm v1.1.0-rc.1 (*)
├── sea-orm-migration v1.1.0-rc.1 (*)
@lcmgh lcmgh changed the title RecordNotFound Error: Failed to find inserted item postgres, RecordNotFound Error: Failed to find inserted item Oct 9, 2024
@lcmgh
Copy link
Author

lcmgh commented Oct 14, 2024

Issue also appears with a composite pk (i32, i64)

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

No branches or pull requests

1 participant