Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Panic when primary key of active model is not set during update #94

Closed
billy1624 opened this issue Aug 18, 2021 · 0 comments
Closed

Panic when primary key of active model is not set during update #94

billy1624 opened this issue Aug 18, 2021 · 0 comments

Comments

@billy1624
Copy link
Member

When a primary key is not included in an active model, sea-orm panics. Could this be handled in a better way?
https://github.com/SeaQL/sea-orm/blob/master/src/query/update.rs#L95

let active_model = cake::ActiveModel {
    // Don't include ID ...
    ..Default::default()
};

let products = Cake::update(active_model).exec(&db).await?;

@acidic9 thanks for raising this issue

@SeaQL SeaQL locked and limited conversation to collaborators Aug 21, 2021
@tyt2y3 tyt2y3 closed this as completed Aug 21, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants