MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createMany

Function createMany

packages/core/fumadb/src/adapters/prisma/query.ts:303–317  ·  view source on GitHub ↗
(table, values)

Source from the content-addressed store, hash-verified

301 );
302 },
303 async createMany(table, values) {
304 await init;
305 const idField = table.getIdColumn().names.prisma;
306 if (relationMode === "prisma") {
307 await Promise.all(
308 table.foreignKeys.map((key) =>
309 checkForeignKeyOnInsert(this, key, values),
310 ),
311 );
312 }
313
314 values = values.map((value) => mapValues(table, value, true));
315 await getPrismaModel(table).createMany({ data: values });
316 return values.map((value) => ({ _id: value[idField] }));
317 },
318 async deleteMany(table, v) {
319 await init;
320 const model = getPrismaModel(table);

Callers

nothing calls this directly

Calls 3

checkForeignKeyOnInsertFunction · 0.90
getPrismaModelFunction · 0.85
mapValuesFunction · 0.70

Tested by

no test coverage detected