In bulk API store command, we consider different modes.
Their names are inspired by SQL, and might change.
We consider a node to be updated if a node with the same id already exists in the repository. Otherwise, we consider that node to be new.
replace
Accept both new and updated nodes.
Pro:
- Main idea of bulk API: "this is how the world should be"
create
Only accept new nodes. The call fails if any node id from nodes already exists in the repository. The call accepts already existing node ids only referenced as child, reference, or annotation.
Pro:
- Easy to check for the repository
- Prevents against accidental changes to nodes with ids we assumed to be free, but aren't
Con:
update
Only accept existing nodes. The call fails if any node id does not exist in the repository.
Pro:
- Easy to check for the repository
- Prevents from accidentally creating new nodes
Con:
Decision: Don't support modes in bulk API store
In bulk API store command, we consider different modes.
Their names are inspired by SQL, and might change.
We consider a node to be updated if a node with the same id already exists in the repository. Otherwise, we consider that node to be new.
replace
Accept both new and updated nodes.
Pro:
create
Only accept new nodes. The call fails if any node id from nodes already exists in the repository. The call accepts already existing node ids only referenced as child, reference, or annotation.
Pro:
Con:
parentfield may only benullfor root nodes #228, we must change the parent when adding a new child. We cannot change an existing node with this mode. According to How to create and delete partitions #216, we create new partitions explicitly. So this mode can never be used.update
Only accept existing nodes. The call fails if any node id does not exist in the repository.
Pro:
Con:
Decision: Don't support modes in bulk API store