MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / upsert

Function upsert

packages/core/src/utils/operations.ts:9–13  ·  view source on GitHub ↗
({ find, create, update }: UpsertOptions<T>)

Source from the content-addressed store, hash-verified

7}
8
9export async function upsert<T>({ find, create, update }: UpsertOptions<T>) {
10 const existing = await find();
11 if (!existing) return create();
12 return update(existing);
13}
14
15export async function upsertMany<T, F, Data>(calls: {
16 input: Data[];

Callers 4

upsertDiscordAccountFunction · 0.90
upsertChannelFunction · 0.90
upsertServerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected