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

Method ForUpdate

ent/nodeversion_query.go:692–700  ·  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

690// updated, deleted or "selected ... for update" by other sessions, until the transaction is
691// either committed or rolled-back.
692func (nvq *NodeVersionQuery) ForUpdate(opts ...sql.LockOption) *NodeVersionQuery {
693 if nvq.driver.Dialect() == dialect.Postgres {
694 nvq.Unique(false)
695 }
696 nvq.modifiers = append(nvq.modifiers, func(s *sql.Selector) {
697 s.ForUpdate(opts...)
698 })
699 return nvq
700}
701
702// ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock
703// on any rows that are read. Other sessions can read the rows, but cannot modify them

Callers

nothing calls this directly

Calls 2

UniqueMethod · 0.95
DialectMethod · 0.80

Tested by

no test coverage detected