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

Function insert_cake

tests/loader_tests.rs:232–246  ·  view source on GitHub ↗
(
    db: &DbConn,
    name: &str,
    bakery_id: Option<i32>,
)

Source from the content-addressed store, hash-verified

230}
231
232pub async fn insert_cake(
233 db: &DbConn,
234 name: &str,
235 bakery_id: Option<i32>,
236) -> Result<cake::Model, DbErr> {
237 cake::ActiveModel {
238 name: Set(name.to_owned()),
239 price: Set(rust_decimal::Decimal::ONE),
240 gluten_free: Set(false),
241 bakery_id: Set(bakery_id),
242 ..Default::default()
243 }
244 .insert(db)
245 .await
246}
247
248pub async fn insert_cake_baker(
249 db: &DbConn,

Callers 2

loader_load_many_multiFunction · 0.85
loader_load_many_to_manyFunction · 0.85

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected