You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2022. It is now read-only.
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 == 0DeletePartialPrimary == 1DeleteMultiple == 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.
The text was updated successfully, but these errors were encountered:
Come to think of it, it's not clear to me why we don't control deletion entirely from the projection spec, there's not really any need for the marker field.
I think this was introduced before we had access to the EventName in a projection filter. The event name is enough to convey deletion semantics in every usage I can think of (usually LogFooBlahDeletion).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 (usually0
). Instead we could sayDeletePrimary == 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, andDeleteMode == "Matching"
will delete any rows that match.The text was updated successfully, but these errors were encountered: