MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / ForShare

Method ForShare

app/controlplane/pkg/data/ent/user_query.go:622–630  ·  view source on GitHub ↗

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

(opts ...sql.LockOption)

Source from the content-addressed store, hash-verified

620// on any rows that are read. Other sessions can read the rows, but cannot modify them
621// until your transaction commits.
622func (_q *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery {
623 if _q.driver.Dialect() == dialect.Postgres {
624 _q.Unique(false)
625 }
626 _q.modifiers = append(_q.modifiers, func(s *sql.Selector) {
627 s.ForShare(opts...)
628 })
629 return _q
630}
631
632// Modify adds a query modifier for attaching custom logic to queries.
633func (_q *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect {

Callers

nothing calls this directly

Calls 2

UniqueMethod · 0.95
DialectMethod · 0.80

Tested by

no test coverage detected