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

Function create_insert_default

tests/insert_default_tests.rs:19–36  ·  view source on GitHub ↗
(db: &DatabaseConnection)

Source from the content-addressed store, hash-verified

17}
18
19pub async fn create_insert_default(db: &DatabaseConnection) -> Result<(), DbErr> {
20 use insert_default::*;
21
22 let active_model = ActiveModel {
23 ..Default::default()
24 };
25
26 active_model.clone().insert(db).await?;
27 active_model.clone().insert(db).await?;
28 active_model.insert(db).await?;
29
30 assert_eq!(
31 Entity::find().all(db).await?,
32 [Model { id: 1 }, Model { id: 2 }, Model { id: 3 }]
33 );
34
35 Ok(())
36}

Callers 1

mainFunction · 0.70

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected