An integer that uniquely identifies a particular query instance within the
database. Used to track input and output dependencies between queries. Fully
ordered and equatable but those orderings are arbitrary, and meant to be used
only for inserting into maps and the like.
Attach the database to the current thread and execute op.
Allows a different database than currently attached. The original database
will be restored on return.
“Fallback” for maybe-update that is suitable for fully owned T
that implement Eq. In this version, we update only if the new value
is not Eq to the old one. Note that given Eq impls that are not just
structurally comparing fields, this may cause us not to update even if
the value has changed (presumably because this change is not semantically
significant).