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

Method insert

src/entity/base_entity.rs:415–420  ·  view source on GitHub ↗

Insert a model into database # 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([[maplit::btreemap! { # "id" => Into:: ::into(15), # }]]) # .into_connection(); # use sea_orm::{entity

(model: A)

Source from the content-addressed store, hash-verified

413 /// # }
414 /// ```
415 fn insert<A>(model: A) -> Insert<A>
416 where
417 A: ActiveModelTrait<Entity = Self>,
418 {
419 Insert::one(model)
420 }
421
422 /// Insert many models into database
423 ///

Callers 15

into_mock_rowMethod · 0.45
load_oneMethod · 0.45
load_manyMethod · 0.45
load_many_to_manyMethod · 0.45
from_query_resultMethod · 0.45
json_schema_from_entityFunction · 0.45
type_def_from_column_defFunction · 0.45
insert_valueFunction · 0.45
postgres_insert_valueFunction · 0.45

Calls

no outgoing calls

Tested by 15

insert_valueFunction · 0.36
postgres_insert_valueFunction · 0.36
create_insert_defaultFunction · 0.36
insert_active_enum_childFunction · 0.36
create_and_updateFunction · 0.36
insert_json_vecFunction · 0.36
loader_load_oneFunction · 0.36
insert_bakeryFunction · 0.36