تخطَّ إلى المحتوى

Missing Bulk Operation (ARCH3053)

هذا المحتوى غير متوفر بلغتك بعد.

Key typescript.orm.missing-bulk-operation · Severity warning · Category orm

Repeating a single-row insert in a loop when a bulk/batch API exists (insertMany/createMany/AddRange/insert_all) produces needless round-trips. Collapse the operations into one bulk call.

for (const u of users) {
await prisma.user.create({ data: u }); // an insert per row
}
await prisma.user.createMany({ data: users }); // one bulk insert

Convert the per-row writes in the loop into the framework’s bulk/batch API (createMany/insertMany).