Function
insert_allocations
(
db: &Database,
allocations: impl Iterator<Item = allocation::ActiveModel>,
)
Source from the content-addressed store, hash-verified
| 219 | } |
| 220 | |
| 221 | pub async fn insert_allocations( |
| 222 | db: &Database, |
| 223 | allocations: impl Iterator<Item = allocation::ActiveModel>, |
| 224 | ) -> Result<(), DbErr> { |
| 225 | let res = Allocation::insert_many(allocations) |
| 226 | .on_empty_do_nothing() |
| 227 | .exec(db.db()) |
| 228 | .await?; |
| 229 | log::debug!("Allocation::insert_many: {:?}", res); |
| 230 | Ok(()) |
| 231 | } |
Tested by
no test coverage detected