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

Function upsertMany

packages/core/sdk/src/plugin-storage.test.ts:140–156  ·  view source on GitHub ↗
(table, options)

Source from the content-addressed store, hash-verified

138 }
139 if (property === "upsertMany") {
140 const upsertMany: FumaDb["upsertMany"] = async (table, options) => {
141 if (table !== "plugin_storage" || options.values.length < 2) {
142 return target.upsertMany(table, options);
143 }
144
145 await target.upsertMany(table, {
146 ...options,
147 values: options.values.slice(0, 1),
148 });
149 // oxlint-disable-next-line executor/no-promise-reject -- boundary: fault-injecting FumaDB adapter must reject to exercise transaction rollback
150 return Promise.reject(
151 new StorageError({
152 message: "Injected plugin storage bulk-write failure.",
153 cause: undefined,
154 }),
155 );
156 };
157 return upsertMany;
158 }
159 return Reflect.get(target, property, receiver);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected