Skip to main content

UPDATE_BINDING

Constant UPDATE_BINDING 

Source
pub const UPDATE_BINDING: &str = "\
UPDATE bindings SET base_flags = :base_flags, \
base_object = :base_object, base_revision = :base_revision, base_present = :base_present, \
conflicted = :conflicted, conflict_revision = :conflict_revision, \
conflict_object = :conflict_object, shared_object = :shared_object \
WHERE collection = :collection AND link_id = :link_id AND source = :source";
Expand description

Updates one existing binding’s columns in place (its primary key (collection, link_id, source) is unchanged).

handle is deliberately not among them, and cannot be. A binding pins one handle, and repointing it would destroy the evidence that a source holds an identity twice, before any later rule could act on it. A write resolving this binding to another handle is refused instead (spec §10), the second copy having a key and an item of its own (spec §9). A legitimate rebind, after a handle-space change, goes through the rebuild that drops the old spine and inserts the new one.