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

Method many

src/query/insert.rs:103–109  ·  view source on GitHub ↗

Insert many Model or ActiveModel ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; assert_eq!( Insert::many([ cake::Model { id: 1, name: "Apple Pie".to_owned(), }, cake::Model { id: 2, name: "Orange Scone".to_owned(), } ]) .build(DbBackend::Postgres) .to_string(), r#"INSERT INTO "cake" ("id", "name") VALUES (1, 'Apple Pie'), (2, 'Orange Scone')"#, ); ```

(models: I)

Source from the content-addressed store, hash-verified

101 /// );
102 /// ```
103 pub fn many<M, I>(models: I) -> Self
104 where
105 M: IntoActiveModel<A>,
106 I: IntoIterator<Item = M>,
107 {
108 Self::new().add_many(models)
109 }
110
111 /// Add a Model to Self
112 ///

Callers

nothing calls this directly

Calls 2

add_manyMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected