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

Function create

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

Source from the content-addressed store, hash-verified

282 await model.updateMany({ where, data: v.set });
283 },
284 async create(table, values) {
285 await init;
286 if (relationMode === "prisma") {
287 await Promise.all(
288 table.foreignKeys.map((key) =>
289 checkForeignKeyOnInsert(this, key, [values]),
290 ),
291 );
292 }
293
294 values = mapValues(table, values, true);
295 const model = getPrismaModel(table);
296 return mapResult(
297 await model.create({
298 data: values,
299 }),
300 table,
301 );
302 },
303 async createMany(table, values) {
304 await init;
305 const idField = table.getIdColumn().names.prisma;

Callers

nothing calls this directly

Calls 4

checkForeignKeyOnInsertFunction · 0.90
getPrismaModelFunction · 0.85
mapValuesFunction · 0.70
mapResultFunction · 0.70

Tested by

no test coverage detected