Replies: 6 comments
-
This issue might also applies to |
Beta Was this translation helpful? Give feedback.
-
Hook's are called from Here sea-orm/src/entity/active_model.rs Lines 292 to 303 in 47c1a9b sea-orm/src/entity/base_entity.rs Lines 365 to 370 in 47c1a9b I think we can add new methods to After that we can change the docs to make user utilize methods from |
Beta Was this translation helpful? Give feedback.
-
I think it's expected that the |
Beta Was this translation helpful? Give feedback.
-
Ping @tyt2y3 |
Beta Was this translation helpful? Give feedback.
-
Agree, but when multiple models were updated using Currently The idea is to add a method in |
Beta Was this translation helpful? Give feedback.
-
I think it is what the API design imply. https://www.sea-ql.org/SeaORM/docs/internal-design/architecture/
While the basic form of fruit::Entity::update(orange.clone()).filter(fruit::Column::Name.contains("orange")).exec(&db) By the time we are about to execute the statement, the query could have been changed, and thus we cannot accurately handle
After an update many statement, we don't have all the updated models in memory. We will need to fetch all the affected models, then invoke the Moving this to discussion and see if we can work out a proposal. |
Beta Was this translation helpful? Give feedback.
-
Description
The title describes it all. I didn't check, but it's possible that other associated methods also don't call these hooks.
Steps to Reproduce
Print a log message inside
before_save
hook and doentity::model::Entity::insert(model).exec(conn)
Expected Behavior
Hooks must be called.
Reproduces How Often
Always.
Beta Was this translation helpful? Give feedback.
All reactions