MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / ForUpdate

Method ForUpdate

ent/node_query.go:683–691  ·  view source on GitHub ↗

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

(opts ...sql.LockOption)

Source from the content-addressed store, hash-verified

681// updated, deleted or "selected ... for update" by other sessions, until the transaction is
682// either committed or rolled-back.
683func (nq *NodeQuery) ForUpdate(opts ...sql.LockOption) *NodeQuery {
684 if nq.driver.Dialect() == dialect.Postgres {
685 nq.Unique(false)
686 }
687 nq.modifiers = append(nq.modifiers, func(s *sql.Selector) {
688 s.ForUpdate(opts...)
689 })
690 return nq
691}
692
693// ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock
694// on any rows that are read. Other sessions can read the rows, but cannot modify them

Callers 1

CreateComfyNodesMethod · 0.45

Calls 2

UniqueMethod · 0.95
DialectMethod · 0.80

Tested by

no test coverage detected