MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / update

Method update

src/entity/base_entity.rs:739–744  ·  view source on GitHub ↗

Update a model in database - To apply where conditions / filters, see [`QueryFilter`](crate::query::QueryFilter) # Example (Postgres) ``` # use sea_orm::{error::*, tests_cfg::*, *}; # # #[smol_potat::main] # #[cfg(feature = "mock")] # pub async fn main() -> Result<(), DbErr> { # # let db = MockDatabase::new(DbBackend::Postgres) # .append_query_results([ # [fruit::Model { #

(model: A)

Source from the content-addressed store, hash-verified

737 /// # }
738 /// ```
739 fn update<A>(model: A) -> UpdateOne<A>
740 where
741 A: ActiveModelTrait<Entity = Self>,
742 {
743 Update::one(model)
744 }
745
746 /// Update many models in database
747 ///

Callers 8

update_collectionFunction · 0.45
create_and_updateFunction · 0.45
create_and_update_piFunction · 0.45
update_embeddingFunction · 0.45
test_update_cakeFunction · 0.45
test_update_bakeryFunction · 0.45

Calls

no outgoing calls

Tested by 8

update_collectionFunction · 0.36
create_and_updateFunction · 0.36
create_and_update_piFunction · 0.36
update_embeddingFunction · 0.36
test_update_cakeFunction · 0.36
test_update_bakeryFunction · 0.36