theconductor
08/19/2024, 9:49 PMnull, currently needs a precondition to check OPERATION_MUST_MATCH on the old value
- Replace a null with a new value, currently needs a precondition to check OPERATION_MUST_NOT_MATCH on any potential old value
- Replace an old value with a new value, currently needs a precondition to check OPERATION_MUST_MATCH on the old value
- many-to-many or one-to-many:
- Set relation to an exact set of values, currently needs a precondition to check OPERATION_MUST_MATCH on all old values
- This is to prevent two concurrent "set" operations succeeding, where the resulting relation contains the union of both sets. This is a situation that could not happen when single-threaded, and so should be avoided when multi-threaded
So I guess I'm asking if spicedb could expose an operation to exactly set a relation, atomically. I know others have asked about one-to-many, ..., etc. semantics, and this could make it a lot easier without any changes to the schema. This might require a new SetRelationship rpc, specifically for the *-to-many case.