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

Function upsert

packages/core/fumadb/src/adapters/prisma/query.ts:325–333  ·  view source on GitHub ↗
(table, { where, ...v })

Source from the content-addressed store, hash-verified

323 await model.deleteMany({ where });
324 },
325 async upsert(table, { where, ...v }) {
326 await init;
327
328 await getPrismaModel(table).upsert({
329 where: where ? buildWhere(where) : {},
330 create: mapValues(table, v.create, true),
331 update: mapValues(table, v.update),
332 });
333 },
334 async transaction(run) {
335 await init;
336

Callers

nothing calls this directly

Calls 3

getPrismaModelFunction · 0.85
buildWhereFunction · 0.70
mapValuesFunction · 0.70

Tested by

no test coverage detected