Skip to content

Batch write: Doing a delete when the value missing seems prone to mistakes #8

@Raynos

Description

@Raynos

Having a batch API that is something like

table.batchWrite([
  { hash: 'foo', range: 'bar', value: { ... } },
  { hash: 'foo': range: 'other', delete: true }
])

Is less likely to delete due to a bug, since the delete is opt in.

we can also add something like

const batch = table.startBatchWrite()
batch.put('foo', 'bar', { ... })
batch.delete('foo', 'other')
const { err } = await batch.commit()

In the future, to support an API with fewer allocations. ( Would be nice to have benchmarks first before doing this ).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions