-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Insert & Update Return Model
#339
Conversation
Still drafting? |
I planned to merge those for 0.4.1
Then, moving on to merge PRs for 0.5.0 (PR mentioned in tentative merge sequence) |
@@ -89,7 +89,7 @@ pub async fn insert_active_enum(db: &DatabaseConnection) -> Result<(), DbErr> { | |||
.unwrap() | |||
); | |||
|
|||
let res = am.delete(db).await?; | |||
let res = model.into_active_model().delete(db).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a wrapper method to Model
so it can be
model.delete(db)
|
||
let result = metadata.clone().insert(db).await?; | ||
let result = metadata.clone().into_active_model().insert(db).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Please open a new PR to address the above suggestions. |
docs: rework `ActiveValue` (SeaQL/sea-orm#340) docs: schema_name will always be applied (SeaQL/sea-orm#370) docs: `ActiveModelBehavior::after_save` takes `Model` (SeaQL/sea-orm#339) docs: `Schema::create_enum_from_active_enum` (SeaQL/sea-orm#348) docs: `ModelTrait::delete` (SeaQL/sea-orm#396) docs: codegen SQLite (SeaQL/sea-orm#386) docs: unsigned integers (SeaQL/sea-orm#397) docs: debug log (SeaQL/sea-orm#373) blog: draft "What's new in SeaORM 0.5.0" docs: revert `save` to return Self (SeaQL/sea-orm@d5c9c65) Revert "docs: unsigned integers (SeaQL/sea-orm#397)" This reverts commit ac6d49e. docs: exclude SeaQL/sea-orm#397 in 0.5.0 blog post docs: update landing page examples docs: edit docs: edit docs: fix 0.4.x docs link build: bump docusaurus version to 2.0.0-beta.14
PR Info
Breaking Changes
insert
,update
andsave
returnModel
instead ofActiveModel
ActiveModelBehavior::after_save
takes<Self::Entity as EntityTrait>::Model
instead ofActiveModel