MCPcopy Index your code
hub / github.com/coder/coder / String

Method String

coderd/database/pglocks.go:43–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (l PGLock) String() string {
44 granted := "granted"
45 if !l.Granted {
46 granted = "waiting"
47 }
48 var details string
49 switch safeString(l.LockType) {
50 case "relation":
51 details = ""
52 case "page":
53 details = fmt.Sprintf("page=%d", *l.Page)
54 case "tuple":
55 details = fmt.Sprintf("page=%d tuple=%d", *l.Page, *l.Tuple)
56 case "virtualxid":
57 details = "waiting to acquire virtual tx id lock"
58 default:
59 details = "???"
60 }
61 return fmt.Sprintf("%d-%5s [%s] %s/%s/%s: %s",
62 l.PID,
63 safeString(l.TransactionID),
64 granted,
65 safeString(l.RelationName),
66 safeString(l.LockType),
67 safeString(l.Mode),
68 details,
69 )
70}
71
72// PGLocks returns a list of all locks in the database currently in use.
73func (q *sqlQuerier) PGLocks(ctx context.Context) (PGLocks, error) {

Callers 15

AuditableMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
RBACObjectMethod · 0.45
AsPrebuildMethod · 0.45
RBACObjectMethod · 0.45

Calls 1

safeStringFunction · 0.85