(data: TInsertInput | Array<TInsertInput>)
| 242 | |
| 243 | return { |
| 244 | writeInsert(data: TInsertInput | Array<TInsertInput>) { |
| 245 | const operation: SyncOperation<TRow, TKey, TInsertInput> = { |
| 246 | type: `insert`, |
| 247 | data, |
| 248 | } |
| 249 | |
| 250 | const ctx = ensureContext() |
| 251 | const batchContext = activeBatchContexts.get(ctx) |
| 252 | |
| 253 | // If we're in a batch, just add to the batch operations |
| 254 | if (batchContext?.isActive) { |
| 255 | batchContext.operations.push(operation) |
| 256 | return |
| 257 | } |
| 258 | |
| 259 | // Otherwise, perform the operation immediately |
| 260 | performWriteOperations(operation, ctx) |
| 261 | }, |
| 262 | |
| 263 | writeUpdate(data: Partial<TRow> | Array<Partial<TRow>>) { |
| 264 | const operation: SyncOperation<TRow, TKey, TInsertInput> = { |
nothing calls this directly
no test coverage detected