MCPcopy Create free account
hub / github.com/TanStack/db / writeUpsert

Function writeUpsert

packages/query-db-collection/src/manual-sync.ts:297–312  ·  view source on GitHub ↗
(data: Partial<TRow> | Array<Partial<TRow>>)

Source from the content-addressed store, hash-verified

295 },
296
297 writeUpsert(data: Partial<TRow> | Array<Partial<TRow>>) {
298 const operation: SyncOperation<TRow, TKey, TInsertInput> = {
299 type: `upsert`,
300 data,
301 }
302
303 const ctx = ensureContext()
304 const batchContext = activeBatchContexts.get(ctx)
305
306 if (batchContext?.isActive) {
307 batchContext.operations.push(operation)
308 return
309 }
310
311 performWriteOperations(operation, ctx)
312 },
313
314 writeBatch(callback: () => void) {
315 const ctx = ensureContext()

Callers

nothing calls this directly

Calls 3

ensureContextFunction · 0.85
performWriteOperationsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected