-
Notifications
You must be signed in to change notification settings - Fork 340
[Vent] Support deletion of multiple rows #1403
Description
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.