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

Method ForUpdate

ent/gitcommit_query.go:535–543  ·  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

533// updated, deleted or "selected ... for update" by other sessions, until the transaction is
534// either committed or rolled-back.
535func (gcq *GitCommitQuery) ForUpdate(opts ...sql.LockOption) *GitCommitQuery {
536 if gcq.driver.Dialect() == dialect.Postgres {
537 gcq.Unique(false)
538 }
539 gcq.modifiers = append(gcq.modifiers, func(s *sql.Selector) {
540 s.ForUpdate(opts...)
541 })
542 return gcq
543}
544
545// ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock
546// 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