Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.
This repository was archived by the owner on May 13, 2022. It is now read-only.

[Vent] Support deletion of multiple rows #1403

Description

@silasdavis

Currently we only support deletion (logic here: https://github.com/hyperledger/burrow/blob/master/vent/service/rowbuilder.go#L46) of single rows by only accepting primary keys (and all parts of composite). This makes sense as as a safer behaviour.

However sometimes it is useful to delete multiple rows with a partial match on primary key (or indeed any key) as in the case of cleaning up orphaned rows in a link table.

We could provide a DeleteMode flag on the projection and/or we could decide to give meaning the the value of the delete marker field which can currently be anything (usually 0). Instead we could say DeletePrimary == 0 DeletePartialPrimary == 1 DeleteMultiple == 2 or something like that.

The latter is simpler to implement but we probably want the flag for safety. The fields in a delete projection are intended to match the primary keys (other keys are ignored). Currently it is an error if we do not have all primary keys set. Perhaps DeleteMode == "Primary" should be default like current behaviour and can be omitted, and DeleteMode == "Matching" will delete any rows that match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions